class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = 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.s: B = None
        self.v: B = None
        self.r: B = None
        self.txt = txt

e = A("e")
j = B("j")
a = C("a")

e.w = a
e.z = j
j.t = a
a.s = j
a.v = j
a.r = j
assert a.s.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = 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.s: B = None
        self.v: B = None
        self.r: B = None
        self.txt = txt

e = A("e")
j = B("j")
a = C("a")

e.w = a
e.z = j
j.t = a
a.s = j
a.v = j
a.r = j
assert a.s.t.s.txt == "j"