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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: D = None
        self.txt = txt

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

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

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

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

n.s = i
n.p = l
n.q = h
l.y = c
l.t = e
h.w = m
h.q = e
h.o = e
h.u = n
h.t = n
d.v = n
d.t = h
d.w = h
d.y = c
d.x = m
i.q = n
a.q = n
m.v = n
m.t = h
m.w = h
m.y = c
m.x = d
c.y = l
c.t = m
e.v = n
e.t = h
e.w = h
e.y = c
e.x = m
assert a.q.q.o.t.w.txt == "m"