class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: I = None
        self.x: B = None
        self.r: B = None
        self.v: C = None
        self.y: C = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.u: E = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: D = None
        self.z: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: H = None
        self.x: C = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.u: E = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: D = None
        self.z: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: H = None
        self.x: C = None
        self.w: B = None
        self.txt = txt

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

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