class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: F = None
        self.t: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: J = None
        self.s: G = None
        self.v: A = None
        self.u: E = None
        self.x: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: B = None
        self.s: F = None
        self.q: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: J = None
        self.r: J = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: C = None
        self.u: F = None
        self.t: H = None
        self.v: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: C = None
        self.x: F = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.z: J = None
        self.s: G = None
        self.v: A = None
        self.u: E = None
        self.x: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: B = None
        self.s: F = None
        self.q: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: J = None
        self.r: J = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: C = None
        self.u: F = None
        self.t: H = None
        self.v: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: C = None
        self.x: F = None
        self.z: A = None
        self.txt = txt

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

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