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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: B = None
        self.t: A = None
        self.txt = txt

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

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