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

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

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

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

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

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

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

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

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

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

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

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

k.w = h
g.u = a
n.z = d
n.s = m
a.w = m
a.o = c
a.s = n
d.s = e
e.w = a
e.o = c
e.s = n
h.s = a
c.u = a
m.w = a
m.o = g
m.s = n
l.w = e
l.o = c
l.s = n
assert c.u.o.u.s.s.o.u.txt == "a"