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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: B = None
        self.r: D = None
        self.q: C = None
        self.o: E = None
        self.txt = txt

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

h.p = e
j.t = h
i.q = j
i.x = e
a.o = j
a.t = i
a.x = i
a.y = l
e.y = i
e.q = i
e.p = j
e.r = a
e.o = c
l.o = j
l.t = i
l.x = i
l.y = a
c.y = i
c.q = i
c.p = j
c.r = n
c.o = e
n.o = j
n.t = i
n.x = i
n.y = l
assert i.x.r.t.q.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: B = None
        self.r: D = None
        self.q: C = None
        self.o: E = None
        self.txt = txt

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

h.p = e
j.t = h
i.q = j
i.x = e
a.o = j
a.t = i
a.x = i
a.y = l
e.y = i
e.q = i
e.p = j
e.r = a
e.o = c
l.o = j
l.t = i
l.x = i
l.y = a
c.y = i
c.q = i
c.p = j
c.r = n
c.o = e
n.o = j
n.t = i
n.x = i
n.y = l
assert i.x.r.t.q.t.p.txt == "e"