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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: G = None
        self.r: H = None
        self.v: H = None
        self.o: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: C = None
        self.z: B = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: I = None
        self.s: J = None
        self.q: F = None
        self.p: D = None
        self.x: C = None
        self.z: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: B = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: G = None
        self.r: H = None
        self.v: H = None
        self.o: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: C = None
        self.z: B = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: I = None
        self.s: J = None
        self.q: F = None
        self.p: D = None
        self.x: C = None
        self.z: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: B = None
        self.z: G = None
        self.txt = txt

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

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