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

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

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

a = A("a")
l = B("l")
n = C("n")
b = B("b")

a.z = n
a.t = l
a.u = l
l.o = b
l.z = b
l.y = n
n.w = l
n.r = a
b.o = l
b.z = l
b.y = n
assert b.z.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: B = None
        self.u: B = None
        self.txt = txt

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

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

a = A("a")
l = B("l")
n = C("n")
b = B("b")

a.z = n
a.t = l
a.u = l
l.o = b
l.z = b
l.y = n
n.w = l
n.r = a
b.o = l
b.z = l
b.y = n
assert b.z.y.r.txt == "a"