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

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

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

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

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

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

j.z = i
m.s = k
n.s = b
h.s = k
l.z = j
k.s = b
i.z = l
b.s = a
a.s = k
e.s = a
assert a.s.s.s.s.s.s.s.s.s.s.txt == "k"