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

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

d.t = l
d.y = l
d.o = l
d.p = b
d.s = b
h.u = b
h.q = b
h.t = l
a.z = l
a.t = d
m.o = h
g.u = b
g.s = h
g.w = k
g.p = e
n.z = l
n.t = e
k.u = h
k.s = h
k.w = g
k.p = e
b.u = h
b.q = h
b.t = m
e.t = l
e.y = l
e.o = l
e.p = h
e.s = h
l.o = h
assert n.t.p.t.o.q.t.o.t.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: D = None
        self.p: B = None
        self.o: D = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

d.t = l
d.y = l
d.o = l
d.p = b
d.s = b
h.u = b
h.q = b
h.t = l
a.z = l
a.t = d
m.o = h
g.u = b
g.s = h
g.w = k
g.p = e
n.z = l
n.t = e
k.u = h
k.s = h
k.w = g
k.p = e
b.u = h
b.q = h
b.t = m
e.t = l
e.y = l
e.o = l
e.p = h
e.s = h
l.o = h
assert n.t.p.t.o.q.t.o.t.o.t.txt == "l"