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

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

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

i = A("i")
f = B("f")
e = C("e")

i.u = f
i.t = e
f.t = i
f.x = e
f.w = e
e.s = i
assert e.s.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: C = None
        self.txt = txt

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

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

i = A("i")
f = B("f")
e = C("e")

i.u = f
i.t = e
f.t = i
f.x = e
f.w = e
e.s = i
assert e.s.t.s.txt == "i"