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

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

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

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

n.v = e
e.z = n
e.t = n
k.o = n
assert e.z.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

n.v = e
e.z = n
e.t = n
k.o = n
assert e.z.v.t.txt == "n"