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

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

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

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

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

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

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

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

i.x = e
i.w = f
f.t = i
e.v = i
assert i.w.t.x.txt == "e"