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

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

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

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

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

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

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

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

k.v = i
k.z = n
n.v = i
i.s = n
i.t = n
i.o = n
assert n.v.o.v.txt == "i"