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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

m.w = i
m.o = g
m.u = g
m.s = h
b.w = m
b.o = l
b.t = a
a.p = g
h.y = g
h.x = g
h.s = n
h.p = b
l.q = h
l.x = m
g.w = i
g.o = m
g.u = m
g.s = h
i.p = m
n.y = m
n.x = m
n.s = h
n.p = b
assert n.p.t.p.s.s.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: A = None
        self.u: A = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

m.w = i
m.o = g
m.u = g
m.s = h
b.w = m
b.o = l
b.t = a
a.p = g
h.y = g
h.x = g
h.s = n
h.p = b
l.q = h
l.x = m
g.w = i
g.o = m
g.u = m
g.s = h
i.p = m
n.y = m
n.x = m
n.s = h
n.p = b
assert n.p.t.p.s.s.x.s.txt == "h"