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

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

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

a = A("a")
l = B("l")
d = C("d")

a.z = d
a.o = l
l.t = d
l.y = a
d.x = l
assert a.o.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: B = None
        self.txt = txt

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

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

a = A("a")
l = B("l")
d = C("d")

a.z = d
a.o = l
l.t = d
l.y = a
d.x = l
assert a.o.t.x.txt == "l"