class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
m = C("m")
b = C("b")

i.p = e
e.t = m
e.o = m
m.u = b
m.z = b
b.u = m
b.z = m
assert m.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
m = C("m")
b = C("b")

i.p = e
e.t = m
e.o = m
m.u = b
m.z = b
b.u = m
b.z = m
assert m.u.u.u.txt == "b"