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

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

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

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

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

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

b.o = k
b.s = a
b.y = a
b.r = g
b.p = e
a.w = m
h.s = l
l.q = h
k.o = a
k.q = a
k.z = g
k.w = h
m.o = a
m.q = a
m.z = e
m.w = h
n.o = m
n.s = a
n.y = a
n.r = e
n.p = g
e.o = k
e.s = a
e.y = a
e.r = b
e.p = g
g.o = m
g.s = a
g.y = a
g.r = e
g.p = b
assert b.s.w.o.w.z.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: B = None
        self.r: A = None
        self.p: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

b.o = k
b.s = a
b.y = a
b.r = g
b.p = e
a.w = m
h.s = l
l.q = h
k.o = a
k.q = a
k.z = g
k.w = h
m.o = a
m.q = a
m.z = e
m.w = h
n.o = m
n.s = a
n.y = a
n.r = e
n.p = g
e.o = k
e.s = a
e.y = a
e.r = b
e.p = g
g.o = m
g.s = a
g.y = a
g.r = e
g.p = b
assert b.s.w.o.w.z.o.w.txt == "h"