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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: H = None
        self.r: A = None
        self.x: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: F = None
        self.q: G = None
        self.w: F = None
        self.x: B = None
        self.p: E = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: H = None
        self.r: A = None
        self.x: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: F = None
        self.q: G = None
        self.w: F = None
        self.x: B = None
        self.p: E = None
        self.u: B = None
        self.txt = txt

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

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