class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: F = None
        self.p: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: J = None
        self.q: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.o: C = None
        self.v: I = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.p: D = None
        self.s: H = None
        self.q: H = None
        self.y: B = None
        self.r: J = None
        self.x: D = None
        self.v: J = None
        self.u: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: B = None
        self.t: G = None
        self.o: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: J = None
        self.q: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.o: C = None
        self.v: I = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.p: D = None
        self.s: H = None
        self.q: H = None
        self.y: B = None
        self.r: J = None
        self.x: D = None
        self.v: J = None
        self.u: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: B = None
        self.t: G = None
        self.o: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: F = None
        self.txt = txt

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

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