class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: G = None
        self.w: G = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: I = None
        self.y: D = None
        self.r: A = None
        self.t: G = None
        self.s: H = None
        self.z: A = None
        self.o: G = None
        self.p: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: A = None
        self.w: H = None
        self.u: C = None
        self.v: D = None
        self.q: H = None
        self.x: H = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: A = None
        self.v: C = None
        self.y: C = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: F = None
        self.o: B = None
        self.p: C = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: B = None
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: I = None
        self.y: D = None
        self.r: A = None
        self.t: G = None
        self.s: H = None
        self.z: A = None
        self.o: G = None
        self.p: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: A = None
        self.w: H = None
        self.u: C = None
        self.v: D = None
        self.q: H = None
        self.x: H = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: A = None
        self.v: C = None
        self.y: C = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: F = None
        self.o: B = None
        self.p: C = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: B = None
        self.o: G = None
        self.txt = txt

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

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