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

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.o: F = None
        self.r: C = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: F = None
        self.x: C = None
        self.p: B = None
        self.w: A = None
        self.txt = txt

i = A("i")
m = B("m")
h = C("h")
f = D("f")
b = E("b")
l = F("l")
n = C("n")
e = F("e")
d = A("d")

i.q = h
i.r = e
i.x = f
i.w = f
i.t = d
m.z = l
m.q = e
m.o = e
h.s = n
h.r = n
h.w = f
h.o = l
h.q = b
f.r = m
f.p = m
f.y = i
f.z = n
f.q = d
f.t = l
b.u = l
b.s = n
l.v = d
l.w = d
l.t = e
l.x = n
l.p = m
n.s = h
n.r = h
n.w = f
n.o = l
n.q = b
e.v = d
e.w = d
e.t = l
e.x = h
e.p = m
d.q = n
d.r = l
d.x = f
d.w = f
d.t = i
assert d.t.w.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: F = None
        self.x: D = None
        self.t: A = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.o: F = None
        self.r: C = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: F = None
        self.x: C = None
        self.p: B = None
        self.w: A = None
        self.txt = txt

i = A("i")
m = B("m")
h = C("h")
f = D("f")
b = E("b")
l = F("l")
n = C("n")
e = F("e")
d = A("d")

i.q = h
i.r = e
i.x = f
i.w = f
i.t = d
m.z = l
m.q = e
m.o = e
h.s = n
h.r = n
h.w = f
h.o = l
h.q = b
f.r = m
f.p = m
f.y = i
f.z = n
f.q = d
f.t = l
b.u = l
b.s = n
l.v = d
l.w = d
l.t = e
l.x = n
l.p = m
n.s = h
n.r = h
n.w = f
n.o = l
n.q = b
e.v = d
e.w = d
e.t = l
e.x = h
e.p = m
d.q = n
d.r = l
d.x = f
d.w = f
d.t = i
assert d.t.w.r.z.txt == "l"