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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: A = None
        self.t: A = None
        self.x: C = None
        self.o: G = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: B = None
        self.s: H = None
        self.v: B = None
        self.w: E = None
        self.q: A = None
        self.u: F = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

n = A("n")
h = B("h")
g = C("g")
l = D("l")
i = E("i")
m = F("m")
e = G("e")
d = H("d")

n.w = h
h.u = l
h.p = m
h.q = i
g.s = e
g.x = n
l.v = d
l.x = h
l.z = e
l.s = e
l.o = g
l.w = n
i.q = d
i.r = n
i.t = n
i.x = g
i.o = e
i.y = e
m.o = n
m.p = l
e.o = m
e.u = m
e.p = h
e.v = h
e.s = d
e.w = i
e.q = n
e.r = n
d.s = m
assert d.s.p.x.u.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: A = None
        self.t: A = None
        self.x: C = None
        self.o: G = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: B = None
        self.s: H = None
        self.v: B = None
        self.w: E = None
        self.q: A = None
        self.u: F = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

n = A("n")
h = B("h")
g = C("g")
l = D("l")
i = E("i")
m = F("m")
e = G("e")
d = H("d")

n.w = h
h.u = l
h.p = m
h.q = i
g.s = e
g.x = n
l.v = d
l.x = h
l.z = e
l.s = e
l.o = g
l.w = n
i.q = d
i.r = n
i.t = n
i.x = g
i.o = e
i.y = e
m.o = n
m.p = l
e.o = m
e.u = m
e.p = h
e.v = h
e.s = d
e.w = i
e.q = n
e.r = n
d.s = m
assert d.s.p.x.u.o.s.txt == "e"