class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.v: B = 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.z: B = None
        self.txt = txt

a = A("a")
b = B("b")
m = C("m")
l = C("l")
c = C("c")
g = B("g")
n = B("n")
e = A("e")
j = A("j")

a.t = l
a.z = b
a.v = g
b.u = a
m.z = g
l.z = g
c.z = g
g.u = a
n.u = a
e.t = c
e.z = n
e.v = b
j.t = l
j.z = b
j.v = b
assert c.z.u.z.u.z.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.v: B = 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.z: B = None
        self.txt = txt

a = A("a")
b = B("b")
m = C("m")
l = C("l")
c = C("c")
g = B("g")
n = B("n")
e = A("e")
j = A("j")

a.t = l
a.z = b
a.v = g
b.u = a
m.z = g
l.z = g
c.z = g
g.u = a
n.u = a
e.t = c
e.z = n
e.v = b
j.t = l
j.z = b
j.v = b
assert c.z.u.z.u.z.u.t.txt == "l"