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

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

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

k = A("k")
j = B("j")
d = C("d")
l = B("l")
n = B("n")
f = C("f")
m = B("m")
e = A("e")
a = B("a")
h = C("h")

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

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

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

k = A("k")
j = B("j")
d = C("d")
l = B("l")
n = B("n")
f = C("f")
m = B("m")
e = A("e")
a = B("a")
h = C("h")

k.o = e
k.z = e
j.s = n
j.u = l
d.s = h
d.o = e
d.z = f
l.s = m
l.u = m
n.s = l
n.u = a
f.s = d
f.z = d
f.o = k
m.s = n
m.u = l
e.o = k
e.z = k
a.s = m
a.u = n
h.s = f
h.o = e
h.z = d
assert m.s.s.u.u.s.u.u.u.txt == "l"