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

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

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

e = A("e")
l = B("l")
b = C("b")
f = B("f")

e.z = f
e.u = b
e.p = b
l.z = e
l.u = f
b.z = f
b.v = e
f.z = e
f.u = l
assert f.z.u.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

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

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

e = A("e")
l = B("l")
b = C("b")
f = B("f")

e.z = f
e.u = b
e.p = b
l.z = e
l.u = f
b.z = f
b.v = e
f.z = e
f.u = l
assert f.z.u.z.u.txt == "l"