class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: D = None
        self.w: A = None
        self.s: A = None
        self.o: C = None
        self.t: C = None
        self.y: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: A = None
        self.z: F = None
        self.x: A = None
        self.p: G = None
        self.v: D = None
        self.q: D = None
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: H = None
        self.txt = txt

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

n = A("n")
l = B("l")
a = C("a")
k = D("k")
f = E("f")
c = F("c")
m = G("m")
g = H("g")
e = A("e")

n.z = g
n.r = k
n.w = e
n.s = e
n.o = a
n.t = a
n.y = c
l.p = f
l.o = m
l.y = m
l.r = c
a.p = k
a.s = m
a.t = f
k.z = a
k.v = a
k.o = a
k.p = n
k.x = l
f.r = m
f.p = m
f.u = n
f.x = n
f.z = c
f.v = k
f.q = k
f.t = g
c.t = m
c.p = l
m.s = f
m.v = g
g.s = k
g.q = k
g.y = k
g.w = l
g.o = e
g.u = m
g.r = f
e.z = g
e.r = k
e.w = n
e.s = n
e.o = a
e.t = a
e.y = c
assert e.r.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: D = None
        self.w: A = None
        self.s: A = None
        self.o: C = None
        self.t: C = None
        self.y: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: A = None
        self.z: F = None
        self.x: A = None
        self.p: G = None
        self.v: D = None
        self.q: D = None
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: H = None
        self.txt = txt

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

n = A("n")
l = B("l")
a = C("a")
k = D("k")
f = E("f")
c = F("c")
m = G("m")
g = H("g")
e = A("e")

n.z = g
n.r = k
n.w = e
n.s = e
n.o = a
n.t = a
n.y = c
l.p = f
l.o = m
l.y = m
l.r = c
a.p = k
a.s = m
a.t = f
k.z = a
k.v = a
k.o = a
k.p = n
k.x = l
f.r = m
f.p = m
f.u = n
f.x = n
f.z = c
f.v = k
f.q = k
f.t = g
c.t = m
c.p = l
m.s = f
m.v = g
g.s = k
g.q = k
g.y = k
g.w = l
g.o = e
g.u = m
g.r = f
e.z = g
e.r = k
e.w = n
e.s = n
e.o = a
e.t = a
e.y = c
assert e.r.o.p.txt == "k"