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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: A = None
        self.q: A = None
        self.w: D = None
        self.v: A = None
        self.txt = txt

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

n.x = c
n.p = m
n.y = m
a.s = k
e.x = a
e.w = a
e.s = n
e.r = d
e.v = m
m.s = c
m.z = h
c.r = m
c.w = m
c.t = n
c.q = d
c.v = d
d.x = c
d.p = m
d.y = m
l.r = m
l.w = m
l.t = n
l.q = d
l.v = d
k.x = a
k.s = n
k.r = n
k.v = m
k.w = h
h.s = e
assert a.s.r.p.z.s.r.x.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: D = None
        self.y: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: A = None
        self.q: A = None
        self.w: D = None
        self.v: A = None
        self.txt = txt

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

n.x = c
n.p = m
n.y = m
a.s = k
e.x = a
e.w = a
e.s = n
e.r = d
e.v = m
m.s = c
m.z = h
c.r = m
c.w = m
c.t = n
c.q = d
c.v = d
d.x = c
d.p = m
d.y = m
l.r = m
l.w = m
l.t = n
l.q = d
l.v = d
k.x = a
k.s = n
k.r = n
k.v = m
k.w = h
h.s = e
assert a.s.r.p.z.s.r.x.t.y.txt == "m"