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

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

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

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

c.s = n
c.u = a
a.y = n
a.t = n
n.x = c
assert n.x.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: B = None
        self.txt = txt

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

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

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

c.s = n
c.u = a
a.y = n
a.t = n
n.x = c
assert n.x.s.x.txt == "c"