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

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

c = A("c")
i = B("i")
e = A("e")
n = B("n")

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

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

c = A("c")
i = B("i")
e = A("e")
n = B("n")

c.u = e
c.o = e
i.y = c
i.v = n
e.u = c
e.o = c
n.y = c
n.v = i
assert c.o.u.o.u.txt == "c"