class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.t: B = None
        self.x: C = None
        self.w: B = None
        self.z: B = None
        self.q: H = None
        self.p: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: F = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.w: F = None
        self.x: D = None
        self.o: G = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.t: B = None
        self.x: C = None
        self.w: B = None
        self.z: B = None
        self.q: H = None
        self.p: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: F = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.w: F = None
        self.x: D = None
        self.o: G = None
        self.q: D = None
        self.txt = txt

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

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