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

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

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

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

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

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

d.q = e
d.p = a
m.u = i
m.o = d
m.t = e
j.u = k
j.y = h
j.x = h
b.t = k
n.p = h
h.u = i
h.o = d
h.t = e
a.p = h
i.t = j
k.u = j
k.y = m
k.x = h
e.p = m
assert j.u.x.t.p.o.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

d.q = e
d.p = a
m.u = i
m.o = d
m.t = e
j.u = k
j.y = h
j.x = h
b.t = k
n.p = h
h.u = i
h.o = d
h.t = e
a.p = h
i.t = j
k.u = j
k.y = m
k.x = h
e.p = m
assert j.u.x.t.p.o.p.p.txt == "h"