class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: A = None
        self.u: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.w: E = None
        self.r: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.w: E = None
        self.r: C = None
        self.txt = txt

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

m.z = a
m.o = n
m.u = n
i.s = g
i.z = e
i.t = m
i.u = n
i.o = h
h.r = n
g.r = l
g.s = m
g.x = e
d.z = c
d.q = g
d.w = a
d.r = e
e.r = n
n.z = l
n.o = m
n.u = m
l.z = g
l.q = c
l.w = a
l.r = e
a.z = g
a.q = c
a.w = l
a.r = h
c.r = a
c.s = m
c.x = h
assert d.q.x.r.z.w.w.r.txt == "e"