class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: D = None
        self.u: A = None
        self.q: A = None
        self.y: B = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: A = None
        self.p: D = None
        self.y: C = None
        self.x: C = None
        self.txt = txt

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

i.x = d
f.z = d
f.o = k
k.q = f
k.z = f
k.o = i
k.w = c
k.v = b
d.z = i
c.r = d
c.o = d
c.u = i
c.q = i
c.y = f
c.p = e
e.q = d
e.p = d
e.r = i
e.y = l
e.x = b
l.q = f
l.z = f
l.o = i
l.w = c
l.v = b
b.q = f
b.z = f
b.o = i
b.w = c
b.v = l
assert k.q.o.v.q.z.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: D = None
        self.u: A = None
        self.q: A = None
        self.y: B = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: A = None
        self.p: D = None
        self.y: C = None
        self.x: C = None
        self.txt = txt

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

i.x = d
f.z = d
f.o = k
k.q = f
k.z = f
k.o = i
k.w = c
k.v = b
d.z = i
c.r = d
c.o = d
c.u = i
c.q = i
c.y = f
c.p = e
e.q = d
e.p = d
e.r = i
e.y = l
e.x = b
l.q = f
l.z = f
l.o = i
l.w = c
l.v = b
b.q = f
b.z = f
b.o = i
b.w = c
b.v = l
assert k.q.o.v.q.z.z.x.txt == "d"