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

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: C = None
        self.txt = txt

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

n.u = h
e.z = k
e.p = d
k.o = h
k.t = h
i.u = h
a.z = h
a.p = m
d.z = k
d.p = a
h.o = k
h.t = k
l.u = k
b.u = k
m.z = h
m.p = e
assert a.p.z.t.o.o.o.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: C = None
        self.txt = txt

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

n.u = h
e.z = k
e.p = d
k.o = h
k.t = h
i.u = h
a.z = h
a.p = m
d.z = k
d.p = a
h.o = k
h.t = k
l.u = k
b.u = k
m.z = h
m.p = e
assert a.p.z.t.o.o.o.o.t.txt == "h"