class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: E = None
        self.v: B = None
        self.y: C = None
        self.x: G = None
        self.w: D = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: G = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: D = None
        self.q: F = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: E = None
        self.o: H = None
        self.p: B = None
        self.w: G = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: D = None
        self.z: H = None
        self.y: D = None
        self.p: B = None
        self.x: C = None
        self.txt = txt

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

n = A("n")
a = B("a")
d = C("d")
j = D("j")
f = E("f")
l = F("l")
h = G("h")
g = H("g")

n.s = a
n.v = a
n.u = a
n.r = f
n.y = d
n.x = h
n.w = j
a.o = l
a.v = n
a.s = d
d.r = g
d.q = h
d.o = l
j.p = g
f.r = a
f.x = j
f.q = l
f.v = d
l.z = n
l.t = f
l.o = g
l.s = g
l.p = a
l.w = h
h.v = g
h.z = g
h.u = j
h.y = j
h.p = a
h.x = d
g.s = f
g.t = n
g.u = l
assert a.s.r.s.x.p.s.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: E = None
        self.v: B = None
        self.y: C = None
        self.x: G = None
        self.w: D = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: G = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: D = None
        self.q: F = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: E = None
        self.o: H = None
        self.p: B = None
        self.w: G = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: D = None
        self.z: H = None
        self.y: D = None
        self.p: B = None
        self.x: C = None
        self.txt = txt

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

n = A("n")
a = B("a")
d = C("d")
j = D("j")
f = E("f")
l = F("l")
h = G("h")
g = H("g")

n.s = a
n.v = a
n.u = a
n.r = f
n.y = d
n.x = h
n.w = j
a.o = l
a.v = n
a.s = d
d.r = g
d.q = h
d.o = l
j.p = g
f.r = a
f.x = j
f.q = l
f.v = d
l.z = n
l.t = f
l.o = g
l.s = g
l.p = a
l.w = h
h.v = g
h.z = g
h.u = j
h.y = j
h.p = a
h.x = d
g.s = f
g.t = n
g.u = l
assert a.s.r.s.x.p.s.q.w.txt == "h"