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

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

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

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

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

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

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

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

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

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

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