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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: D = None
        self.z: E = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: E = None
        self.v: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: D = None
        self.z: E = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: E = None
        self.v: B = None
        self.txt = txt

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

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

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