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

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

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

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

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

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

m.q = k
m.u = h
m.w = b
n.s = b
n.t = g
b.s = h
b.o = n
b.w = c
g.r = l
l.s = n
l.t = m
l.o = g
l.r = c
k.q = e
k.u = h
k.w = b
h.s = n
h.r = n
h.t = e
h.o = f
c.s = b
c.t = g
e.q = m
e.u = l
e.w = b
f.r = h
assert n.s.o.s.w.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: E = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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