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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: C = None
        self.p: H = None
        self.w: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: D = None
        self.t: G = None
        self.z: G = None
        self.r: A = None
        self.x: H = None
        self.w: G = None
        self.q: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: J = None
        self.u: F = None
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: J = None
        self.z: E = None
        self.w: F = None
        self.r: C = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.x: G = None
        self.o: A = None
        self.y: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: C = None
        self.p: H = None
        self.w: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: D = None
        self.t: G = None
        self.z: G = None
        self.r: A = None
        self.x: H = None
        self.w: G = None
        self.q: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: J = None
        self.u: F = None
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: J = None
        self.z: E = None
        self.w: F = None
        self.r: C = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.x: G = None
        self.o: A = None
        self.y: I = None
        self.txt = txt

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

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