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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: C = None
        self.s: C = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: F = None
        self.t: A = None
        self.v: A = None
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: C = None
        self.s: C = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: F = None
        self.t: A = None
        self.v: A = None
        self.z: B = None
        self.txt = txt

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

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