class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.s: D = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: A = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

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

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

e = A("e")
j = B("j")
l = C("l")
m = D("m")
h = E("h")
f = E("f")
a = A("a")
n = A("n")
c = D("c")
i = C("i")

e.y = m
j.w = f
j.q = f
j.r = h
j.s = m
l.s = n
l.o = e
l.p = f
l.z = i
m.w = n
m.p = n
m.o = h
h.u = c
h.s = m
h.r = i
h.w = j
f.u = m
f.s = m
f.r = l
f.w = j
a.y = m
n.y = m
c.w = n
c.o = f
c.p = e
i.s = a
i.o = e
i.p = f
i.z = l
assert l.z.p.r.s.y.o.r.o.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.s: D = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: A = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

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

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

e = A("e")
j = B("j")
l = C("l")
m = D("m")
h = E("h")
f = E("f")
a = A("a")
n = A("n")
c = D("c")
i = C("i")

e.y = m
j.w = f
j.q = f
j.r = h
j.s = m
l.s = n
l.o = e
l.p = f
l.z = i
m.w = n
m.p = n
m.o = h
h.u = c
h.s = m
h.r = i
h.w = j
f.u = m
f.s = m
f.r = l
f.w = j
a.y = m
n.y = m
c.w = n
c.o = f
c.p = e
i.s = a
i.o = e
i.p = f
i.z = l
assert l.z.p.r.s.y.o.r.o.y.o.txt == "h"