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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: D = None
        self.t: C = None
        self.u: F = None
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: C = None
        self.o: H = None
        self.t: A = None
        self.v: H = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: D = None
        self.t: C = None
        self.u: F = None
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: C = None
        self.o: H = None
        self.t: A = None
        self.v: H = None
        self.q: H = None
        self.txt = txt

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

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

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

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