class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: D = None
        self.u: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: B = None
        self.t: E = None
        self.o: F = None
        self.w: F = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: C = None
        self.r: F = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

k = A("k")
b = B("b")
a = C("a")
i = D("i")
d = E("d")
e = F("e")
l = B("l")
f = C("f")

k.v = f
b.z = e
b.w = i
b.u = l
a.x = e
i.q = f
i.x = b
i.t = d
i.o = e
i.w = e
i.z = k
d.q = k
d.s = a
d.r = e
d.v = e
d.t = l
e.u = i
l.z = e
l.w = i
l.u = b
f.x = e
assert f.x.u.w.u.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: D = None
        self.u: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: B = None
        self.t: E = None
        self.o: F = None
        self.w: F = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: C = None
        self.r: F = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

k = A("k")
b = B("b")
a = C("a")
i = D("i")
d = E("d")
e = F("e")
l = B("l")
f = C("f")

k.v = f
b.z = e
b.w = i
b.u = l
a.x = e
i.q = f
i.x = b
i.t = d
i.o = e
i.w = e
i.z = k
d.q = k
d.s = a
d.r = e
d.v = e
d.t = l
e.u = i
l.z = e
l.w = i
l.u = b
f.x = e
assert f.x.u.w.u.w.u.txt == "i"