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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: H = None
        self.u: C = None
        self.s: A = None
        self.t: H = None
        self.v: H = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.y: B = None
        self.s: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: F = None
        self.v: D = None
        self.q: A = None
        self.s: H = None
        self.r: E = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: E = None
        self.u: A = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

b = A("b")
m = B("m")
a = C("a")
e = D("e")
n = E("n")
h = F("h")
l = G("l")
j = H("j")
d = F("d")

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: H = None
        self.u: C = None
        self.s: A = None
        self.t: H = None
        self.v: H = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: B = None
        self.y: B = None
        self.s: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: F = None
        self.v: D = None
        self.q: A = None
        self.s: H = None
        self.r: E = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: E = None
        self.u: A = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

b = A("b")
m = B("m")
a = C("a")
e = D("e")
n = E("n")
h = F("h")
l = G("l")
j = H("j")
d = F("d")

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