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

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

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

i = A("i")
n = B("n")
e = C("e")
m = C("m")
b = A("b")
k = C("k")
c = B("c")
a = C("a")
l = A("l")

i.z = m
n.u = b
n.v = b
n.t = c
e.o = m
m.o = a
b.z = k
k.o = a
c.u = i
c.v = l
c.t = n
a.o = m
l.z = a
assert c.t.u.z.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
e = C("e")
m = C("m")
b = A("b")
k = C("k")
c = B("c")
a = C("a")
l = A("l")

i.z = m
n.u = b
n.v = b
n.t = c
e.o = m
m.o = a
b.z = k
k.o = a
c.u = i
c.v = l
c.t = n
a.o = m
l.z = a
assert c.t.u.z.o.o.o.o.txt == "m"