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

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

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

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

n.w = l
l.p = e
l.y = n
l.w = n
e.r = k
e.u = k
m.r = k
m.u = k
b.r = k
b.u = h
k.p = b
k.y = n
k.w = n
j.r = h
j.u = l
a.r = h
a.u = k
h.p = a
h.y = n
h.w = n
assert e.r.p.r.y.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

n.w = l
l.p = e
l.y = n
l.w = n
e.r = k
e.u = k
m.r = k
m.u = k
b.r = k
b.u = h
k.p = b
k.y = n
k.w = n
j.r = h
j.u = l
a.r = h
a.u = k
h.p = a
h.y = n
h.w = n
assert e.r.p.r.y.w.y.txt == "n"