class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: B = None
        self.o: H = None
        self.s: H = None
        self.z: G = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: C = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: G = None
        self.v: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: C = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: G = None
        self.v: B = None
        self.txt = txt

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

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

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