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

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

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

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

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

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

m.w = e
m.o = k
c.q = k
c.z = m
n.w = c
n.o = e
l.w = k
l.o = c
b.w = k
b.o = c
k.q = c
k.z = b
i.w = k
i.o = c
e.q = c
e.z = n
assert n.o.q.q.q.z.o.q.txt == "c"