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

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

e = A("e")
n = B("n")
j = B("j")
c = B("c")
l = A("l")
m = B("m")
a = A("a")

e.v = l
n.z = j
j.z = c
c.z = n
l.v = a
m.z = j
a.v = l
assert n.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

e = A("e")
n = B("n")
j = B("j")
c = B("c")
l = A("l")
m = B("m")
a = A("a")

e.v = l
n.z = j
j.z = c
c.z = n
l.v = a
m.z = j
a.v = l
assert n.z.z.z.txt == "n"