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

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

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

c = A("c")
j = B("j")
a = C("a")

c.s = a
c.z = a
c.o = a
j.t = a
a.r = c
a.x = j
assert a.r.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: C = None
        self.o: C = None
        self.txt = txt

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

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

c = A("c")
j = B("j")
a = C("a")

c.s = a
c.z = a
c.o = a
j.t = a
a.r = c
a.x = j
assert a.r.z.x.txt == "j"