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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: A = None
        self.p: D = None
        self.q: H = None
        self.y: I = None
        self.r: F = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: G = None
        self.o: I = None
        self.q: G = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: D = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: D = None
        self.t: B = None
        self.p: E = None
        self.q: C = None
        self.y: B = None
        self.v: B = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: A = None
        self.p: D = None
        self.q: H = None
        self.y: I = None
        self.r: F = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: G = None
        self.o: I = None
        self.q: G = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: D = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: D = None
        self.t: B = None
        self.p: E = None
        self.q: C = None
        self.y: B = None
        self.v: B = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

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

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