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

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

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

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

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

n = A("n")
a = B("a")
h = C("h")
b = D("b")
l = E("l")
f = B("f")
k = E("k")
c = D("c")
m = A("m")

n.z = m
a.q = m
a.s = f
a.t = k
a.y = k
h.u = b
b.u = n
l.y = h
l.w = k
f.q = n
f.s = a
f.t = k
f.y = l
k.y = h
k.w = l
c.u = n
m.z = n
assert h.u.u.z.z.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

n = A("n")
a = B("a")
h = C("h")
b = D("b")
l = E("l")
f = B("f")
k = E("k")
c = D("c")
m = A("m")

n.z = m
a.q = m
a.s = f
a.t = k
a.y = k
h.u = b
b.u = n
l.y = h
l.w = k
f.q = n
f.s = a
f.t = k
f.y = l
k.y = h
k.w = l
c.u = n
m.z = n
assert h.u.u.z.z.z.z.z.z.z.txt == "m"