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

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

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

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

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

i = A("i")
k = B("k")
m = C("m")
b = D("b")
a = E("a")
c = E("c")
g = B("g")
h = E("h")
f = B("f")
d = E("d")

i.o = b
k.w = b
k.u = b
k.p = g
m.q = b
m.w = b
m.s = i
b.s = m
a.u = h
a.s = m
a.w = k
a.t = d
a.v = f
c.u = h
c.t = h
c.s = m
c.w = k
c.v = f
g.w = b
g.u = b
g.p = f
h.u = d
h.t = d
h.s = m
h.w = g
h.v = k
f.w = b
f.u = b
f.p = g
d.u = a
d.t = a
d.s = m
d.w = f
d.v = f
assert a.s.s.o.s.w.s.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

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

i = A("i")
k = B("k")
m = C("m")
b = D("b")
a = E("a")
c = E("c")
g = B("g")
h = E("h")
f = B("f")
d = E("d")

i.o = b
k.w = b
k.u = b
k.p = g
m.q = b
m.w = b
m.s = i
b.s = m
a.u = h
a.s = m
a.w = k
a.t = d
a.v = f
c.u = h
c.t = h
c.s = m
c.w = k
c.v = f
g.w = b
g.u = b
g.p = f
h.u = d
h.t = d
h.s = m
h.w = g
h.v = k
f.w = b
f.u = b
f.p = g
d.u = a
d.t = a
d.s = m
d.w = f
d.v = f
assert a.s.s.o.s.w.s.w.s.txt == "m"