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

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

n = A("n")
l = B("l")
b = B("b")
a = A("a")
e = A("e")
k = B("k")
i = B("i")

n.w = k
l.z = e
l.s = e
b.z = n
b.s = n
a.w = b
e.w = i
k.z = e
k.s = n
i.z = e
i.s = n
assert n.w.z.w.z.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

n = A("n")
l = B("l")
b = B("b")
a = A("a")
e = A("e")
k = B("k")
i = B("i")

n.w = k
l.z = e
l.s = e
b.z = n
b.s = n
a.w = b
e.w = i
k.z = e
k.s = n
i.z = e
i.s = n
assert n.w.z.w.z.w.z.txt == "e"