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

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

e = A("e")
n = B("n")
i = A("i")
l = B("l")
h = A("h")
c = B("c")
j = A("j")
a = A("a")
m = B("m")
g = A("g")

e.u = h
e.o = n
n.w = a
n.p = j
i.u = j
i.o = l
l.w = h
l.p = h
h.u = e
h.o = c
c.w = e
c.p = h
j.u = i
j.o = c
a.u = h
a.o = l
m.w = g
m.p = e
g.u = a
g.o = l
assert l.p.u.o.p.u.u.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

e = A("e")
n = B("n")
i = A("i")
l = B("l")
h = A("h")
c = B("c")
j = A("j")
a = A("a")
m = B("m")
g = A("g")

e.u = h
e.o = n
n.w = a
n.p = j
i.u = j
i.o = l
l.w = h
l.p = h
h.u = e
h.o = c
c.w = e
c.p = h
j.u = i
j.o = c
a.u = h
a.o = l
m.w = g
m.p = e
g.u = a
g.o = l
assert l.p.u.o.p.u.u.u.o.txt == "l"