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

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

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

a = A("a")
l = B("l")
d = C("d")
e = B("e")
j = C("j")
g = C("g")
i = B("i")
f = A("f")
m = C("m")
b = A("b")

a.x = m
l.z = e
l.t = d
d.u = f
d.y = i
e.z = l
e.t = m
j.u = a
j.y = i
g.u = a
g.y = i
i.z = l
i.t = m
f.x = d
m.u = f
m.y = i
b.x = m
assert l.t.y.t.u.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

a = A("a")
l = B("l")
d = C("d")
e = B("e")
j = C("j")
g = C("g")
i = B("i")
f = A("f")
m = C("m")
b = A("b")

a.x = m
l.z = e
l.t = d
d.u = f
d.y = i
e.z = l
e.t = m
j.u = a
j.y = i
g.u = a
g.y = i
i.z = l
i.t = m
f.x = d
m.u = f
m.y = i
b.x = m
assert l.t.y.t.u.x.y.txt == "i"