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

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

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

i = A("i")
a = B("a")
e = C("e")
c = A("c")
h = A("h")
m = B("m")
j = C("j")
l = B("l")
n = B("n")
f = A("f")

i.t = f
a.u = e
a.z = e
a.q = l
e.o = j
c.t = f
h.t = f
m.u = j
m.q = n
m.z = e
j.o = e
l.u = j
l.z = j
l.q = n
n.u = e
n.z = e
n.q = m
f.t = c
assert i.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

i = A("i")
a = B("a")
e = C("e")
c = A("c")
h = A("h")
m = B("m")
j = C("j")
l = B("l")
n = B("n")
f = A("f")

i.t = f
a.u = e
a.z = e
a.q = l
e.o = j
c.t = f
h.t = f
m.u = j
m.q = n
m.z = e
j.o = e
l.u = j
l.z = j
l.q = n
n.u = e
n.z = e
n.q = m
f.t = c
assert i.t.t.t.t.txt == "c"