class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: B = None
        self.v: 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.o: B = None
        self.txt = txt

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

e.x = c
e.v = c
e.y = f
f.t = c
c.o = f
assert f.t.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: B = None
        self.v: 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.o: B = None
        self.txt = txt

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

e.x = c
e.v = c
e.y = f
f.t = c
c.o = f
assert f.t.o.t.txt == "c"