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

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

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

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

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

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

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

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

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

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

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

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

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