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

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

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

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

f.v = d
f.z = d
f.t = e
e.s = d
d.w = f
d.q = e
assert d.w.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

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

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

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

f.v = d
f.z = d
f.t = e
e.s = d
d.w = f
d.q = e
assert d.w.v.w.txt == "f"