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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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