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

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

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

e = A("e")
b = B("b")
a = C("a")

e.o = b
e.z = b
b.s = a
b.y = a
a.u = e
a.x = e
assert a.u.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.txt = txt

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

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

e = A("e")
b = B("b")
a = C("a")

e.o = b
e.z = b
b.s = a
b.y = a
a.u = e
a.x = e
assert a.u.z.s.txt == "a"