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

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

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

e = A("e")
d = B("d")
f = C("f")
k = A("k")
g = A("g")
n = B("n")
h = A("h")
c = B("c")
a = B("a")
l = C("l")

e.p = l
e.r = a
e.o = n
d.t = h
d.s = k
f.u = n
k.p = l
k.r = n
k.o = n
g.p = f
g.r = c
g.o = d
n.t = k
n.s = e
h.p = l
h.r = n
h.o = a
c.t = h
c.s = g
a.t = e
a.s = g
l.u = c
assert e.o.s.o.s.p.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: B = None
        self.o: B = None
        self.txt = txt

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

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

e = A("e")
d = B("d")
f = C("f")
k = A("k")
g = A("g")
n = B("n")
h = A("h")
c = B("c")
a = B("a")
l = C("l")

e.p = l
e.r = a
e.o = n
d.t = h
d.s = k
f.u = n
k.p = l
k.r = n
k.o = n
g.p = f
g.r = c
g.o = d
n.t = k
n.s = e
h.p = l
h.r = n
h.o = a
c.t = h
c.s = g
a.t = e
a.s = g
l.u = c
assert e.o.s.o.s.p.u.t.txt == "h"