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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: C = None
        self.u: D = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: B = None
        self.r: B = None
        self.y: A = None
        self.txt = txt

i = A("i")
g = B("g")
l = C("l")
f = D("f")
j = E("j")
n = F("n")
d = D("d")
b = F("b")

i.z = f
i.r = f
i.t = j
g.q = f
g.z = l
l.w = g
l.t = d
l.o = f
f.w = l
f.v = l
f.y = l
f.u = d
j.q = i
j.z = f
n.t = g
n.s = g
n.r = g
n.y = i
d.w = l
d.v = l
d.y = l
d.u = f
b.t = g
b.s = g
b.r = g
b.y = i
assert j.z.u.u.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: D = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: C = None
        self.u: D = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: B = None
        self.r: B = None
        self.y: A = None
        self.txt = txt

i = A("i")
g = B("g")
l = C("l")
f = D("f")
j = E("j")
n = F("n")
d = D("d")
b = F("b")

i.z = f
i.r = f
i.t = j
g.q = f
g.z = l
l.w = g
l.t = d
l.o = f
f.w = l
f.v = l
f.y = l
f.u = d
j.q = i
j.z = f
n.t = g
n.s = g
n.r = g
n.y = i
d.w = l
d.v = l
d.y = l
d.u = f
b.t = g
b.s = g
b.r = g
b.y = i
assert j.z.u.u.u.w.txt == "l"