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

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

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

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

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

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

m.v = e
m.u = i
m.p = i
m.s = g
m.z = a
i.o = a
i.u = l
i.v = n
c.v = a
c.s = l
c.p = i
a.o = l
a.r = g
a.s = j
g.w = a
e.v = m
e.u = j
e.p = j
e.s = g
e.z = a
l.o = a
l.r = g
l.s = i
n.v = a
n.s = a
n.p = i
h.v = m
h.u = j
h.p = j
h.s = g
h.z = l
j.o = l
j.u = a
j.v = c
assert a.r.w.r.w.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: B = None
        self.s: E = None
        self.p: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

m.v = e
m.u = i
m.p = i
m.s = g
m.z = a
i.o = a
i.u = l
i.v = n
c.v = a
c.s = l
c.p = i
a.o = l
a.r = g
a.s = j
g.w = a
e.v = m
e.u = j
e.p = j
e.s = g
e.z = a
l.o = a
l.r = g
l.s = i
n.v = a
n.s = a
n.p = i
h.v = m
h.u = j
h.p = j
h.s = g
h.z = l
j.o = l
j.u = a
j.v = c
assert a.r.w.r.w.s.o.txt == "l"