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

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

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

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

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

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

n.w = m
e.u = h
e.w = m
e.y = k
i.s = n
i.u = e
c.r = i
c.q = n
h.p = c
h.t = e
h.r = m
m.p = l
m.t = e
m.r = h
b.r = i
b.q = k
k.w = h
g.s = n
g.u = e
l.r = i
l.q = k
assert n.w.r.t.y.w.p.r.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: E = None
        self.w: E = None
        self.y: A = None
        self.txt = txt

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

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

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

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

n.w = m
e.u = h
e.w = m
e.y = k
i.s = n
i.u = e
c.r = i
c.q = n
h.p = c
h.t = e
h.r = m
m.p = l
m.t = e
m.r = h
b.r = i
b.q = k
k.w = h
g.s = n
g.u = e
l.r = i
l.q = k
assert n.w.r.t.y.w.p.r.u.txt == "e"