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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.t: A = None
        self.u: A = None
        self.v: G = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.t: A = None
        self.u: A = None
        self.v: G = None
        self.y: F = None
        self.txt = txt

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

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

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

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