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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.s: F = None
        self.p: C = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: H = None
        self.x: G = None
        self.v: A = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: C = None
        self.r: B = None
        self.o: A = None
        self.t: H = None
        self.y: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: C = None
        self.y: J = None
        self.s: A = None
        self.z: B = None
        self.x: H = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: D = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: I = None
        self.p: A = None
        self.x: G = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.s: F = None
        self.p: C = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: H = None
        self.x: G = None
        self.v: A = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: C = None
        self.r: B = None
        self.o: A = None
        self.t: H = None
        self.y: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: C = None
        self.y: J = None
        self.s: A = None
        self.z: B = None
        self.x: H = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: D = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: I = None
        self.p: A = None
        self.x: G = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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