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

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

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

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

c.t = e
c.z = e
c.y = e
e.v = c
e.w = n
n.s = c
assert e.v.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.y: B = None
        self.txt = txt

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

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

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

c.t = e
c.z = e
c.y = e
e.v = c
e.w = n
n.s = c
assert e.v.t.w.txt == "n"