class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: D = None
        self.u: G = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: G = None
        self.u: C = None
        self.p: D = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: E = None
        self.w: B = None
        self.y: H = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: H = None
        self.t: G = None
        self.u: H = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: F = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: G = None
        self.u: C = None
        self.p: D = None
        self.w: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: E = None
        self.w: B = None
        self.y: H = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: H = None
        self.t: G = None
        self.u: H = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: F = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

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

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