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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: E = None
        self.txt = txt

k = A("k")
j = B("j")
g = C("g")
c = D("c")
d = E("d")
e = A("e")
f = E("f")
b = E("b")
m = C("m")
h = D("h")

k.t = m
k.u = j
k.o = e
j.u = e
g.s = e
g.u = h
c.r = m
c.t = h
c.s = j
c.q = j
d.p = h
d.y = b
e.t = g
e.u = j
e.o = k
f.p = h
f.y = b
b.p = h
b.y = f
m.s = e
m.u = c
h.r = g
h.t = c
h.s = j
h.q = j
assert h.t.s.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: B = None
        self.o: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: E = None
        self.txt = txt

k = A("k")
j = B("j")
g = C("g")
c = D("c")
d = E("d")
e = A("e")
f = E("f")
b = E("b")
m = C("m")
h = D("h")

k.t = m
k.u = j
k.o = e
j.u = e
g.s = e
g.u = h
c.r = m
c.t = h
c.s = j
c.q = j
d.p = h
d.y = b
e.t = g
e.u = j
e.o = k
f.p = h
f.y = b
b.p = h
b.y = f
m.s = e
m.u = c
h.r = g
h.t = c
h.s = j
h.q = j
assert h.t.s.u.u.u.txt == "e"