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

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

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

b = A("b")
a = B("a")
l = C("l")
k = B("k")
j = B("j")
m = A("m")
c = A("c")

b.x = l
b.z = l
a.u = l
a.x = l
l.r = m
l.o = k
l.x = j
k.u = l
k.x = l
j.u = l
j.x = l
m.x = l
m.z = l
c.x = l
c.z = l
assert m.x.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

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

b = A("b")
a = B("a")
l = C("l")
k = B("k")
j = B("j")
m = A("m")
c = A("c")

b.x = l
b.z = l
a.u = l
a.x = l
l.r = m
l.o = k
l.x = j
k.u = l
k.x = l
j.u = l
j.x = l
m.x = l
m.z = l
c.x = l
c.z = l
assert m.x.r.x.txt == "l"