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

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

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

i = A("i")
a = B("a")
n = C("n")
e = C("e")

i.v = n
i.y = a
a.o = e
n.y = e
e.y = n
assert a.o.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: B = None
        self.txt = txt

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

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

i = A("i")
a = B("a")
n = C("n")
e = C("e")

i.v = n
i.y = a
a.o = e
n.y = e
e.y = n
assert a.o.y.y.y.txt == "n"