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

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

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

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

e.t = k
e.v = c
k.w = e
k.v = c
c.o = e
c.r = e
c.v = e
assert e.t.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: C = None
        self.txt = txt

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

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

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

e.t = k
e.v = c
k.w = e
k.v = c
c.o = e
c.r = e
c.v = e
assert e.t.v.r.txt == "e"