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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.z: D = None
        self.u: C = None
        self.r: A = None
        self.txt = txt

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

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

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

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

l.y = k
l.r = h
l.t = d
l.v = i
l.o = e
i.q = k
i.p = l
i.r = l
i.z = h
i.u = j
d.r = k
m.z = j
m.t = l
e.q = i
e.o = i
e.y = i
h.z = j
h.t = a
j.r = a
a.y = k
a.r = h
a.t = j
a.v = i
a.o = e
k.y = l
k.r = m
k.t = j
k.v = i
k.o = e
assert h.t.t.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: D = None
        self.t: C = None
        self.v: B = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.z: D = None
        self.u: C = None
        self.r: A = None
        self.txt = txt

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

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

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

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

l.y = k
l.r = h
l.t = d
l.v = i
l.o = e
i.q = k
i.p = l
i.r = l
i.z = h
i.u = j
d.r = k
m.z = j
m.t = l
e.q = i
e.o = i
e.y = i
h.z = j
h.t = a
j.r = a
a.y = k
a.r = h
a.t = j
a.v = i
a.o = e
k.y = l
k.r = m
k.t = j
k.v = i
k.o = e
assert h.t.t.r.r.txt == "h"