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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: I = None
        self.w: D = None
        self.o: G = None
        self.y: A = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: B = None
        self.v: F = None
        self.u: H = None
        self.r: D = None
        self.q: H = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: I = None
        self.w: D = None
        self.o: G = None
        self.y: A = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: B = None
        self.v: F = None
        self.u: H = None
        self.r: D = None
        self.q: H = None
        self.t: E = None
        self.txt = txt

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

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