class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: G = None
        self.s: F = None
        self.y: D = None
        self.p: E = None
        self.q: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: A = None
        self.s: B = None
        self.z: E = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: G = None
        self.w: C = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: D = None
        self.r: F = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: B = None
        self.u: B = None
        self.o: E = None
        self.p: E = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: A = None
        self.s: B = None
        self.z: E = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: G = None
        self.w: C = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: D = None
        self.r: F = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: B = None
        self.u: B = None
        self.o: E = None
        self.p: E = None
        self.t: A = None
        self.txt = txt

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

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