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

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

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

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

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

n = A("n")
e = B("e")
d = C("d")
m = D("m")
b = E("b")
k = C("k")
j = D("j")
a = C("a")
i = B("i")

n.q = b
e.w = m
e.r = m
e.s = m
e.u = a
d.w = m
d.x = m
d.v = e
d.s = a
d.o = b
m.p = n
m.w = n
m.x = i
m.s = e
b.w = m
k.w = j
k.x = j
k.v = i
k.s = a
k.o = b
j.p = n
j.w = n
j.x = e
j.s = i
a.w = m
a.v = i
a.s = d
a.o = b
a.x = j
i.w = m
i.r = m
i.s = m
i.u = a
assert k.o.w.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

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

n = A("n")
e = B("e")
d = C("d")
m = D("m")
b = E("b")
k = C("k")
j = D("j")
a = C("a")
i = B("i")

n.q = b
e.w = m
e.r = m
e.s = m
e.u = a
d.w = m
d.x = m
d.v = e
d.s = a
d.o = b
m.p = n
m.w = n
m.x = i
m.s = e
b.w = m
k.w = j
k.x = j
k.v = i
k.s = a
k.o = b
j.p = n
j.w = n
j.x = e
j.s = i
a.w = m
a.v = i
a.s = d
a.o = b
a.x = j
i.w = m
i.r = m
i.s = m
i.u = a
assert k.o.w.p.q.txt == "b"