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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: C = None
        self.x: C = None
        self.r: B = None
        self.txt = txt

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

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

k.w = j
k.p = l
k.t = b
d.q = n
d.s = a
d.r = h
d.z = l
l.z = d
l.q = d
h.u = k
h.o = l
h.x = l
h.r = d
j.t = b
j.z = h
n.z = d
n.q = d
i.u = k
i.o = n
i.x = n
i.r = d
a.u = g
a.o = n
a.x = l
a.r = d
g.w = b
g.p = l
g.t = j
b.t = j
b.z = i
assert j.t.t.z.o.z.q.q.q.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: C = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: C = None
        self.x: C = None
        self.r: B = None
        self.txt = txt

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

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

k.w = j
k.p = l
k.t = b
d.q = n
d.s = a
d.r = h
d.z = l
l.z = d
l.q = d
h.u = k
h.o = l
h.x = l
h.r = d
j.t = b
j.z = h
n.z = d
n.q = d
i.u = k
i.o = n
i.x = n
i.r = d
a.u = g
a.o = n
a.x = l
a.r = d
g.w = b
g.p = l
g.t = j
b.t = j
b.z = i
assert j.t.t.z.o.z.q.q.q.z.q.txt == "n"