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

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

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

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

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

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

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

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

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

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

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

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

i.p = h
i.z = d
i.s = d
i.o = l
l.r = e
l.o = f
l.z = h
l.s = h
h.u = e
h.w = l
h.q = l
d.q = a
d.y = f
k.p = g
k.v = h
f.q = a
f.y = d
e.u = g
e.w = l
e.q = l
m.p = h
m.z = d
m.o = l
m.s = f
g.u = h
g.w = l
g.q = l
a.p = e
a.z = d
a.o = l
a.s = f
assert a.p.u.u.u.w.o.q.s.q.txt == "a"