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

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

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

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

e.t = k
e.v = k
i.v = k
i.o = k
k.x = e
assert e.v.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: C = None
        self.txt = txt

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

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

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

e.t = k
e.v = k
i.v = k
i.o = k
k.x = e
assert e.v.x.t.txt == "k"