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

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

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

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

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

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

i.y = n
i.o = e
k.z = i
k.y = n
c.z = i
c.y = e
e.z = i
e.y = k
n.z = i
n.y = c
assert e.y.y.z.y.txt == "n"