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

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

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

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

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

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

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

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

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

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

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

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

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