class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: I = None
        self.w: A = None
        self.q: H = None
        self.y: F = None
        self.p: F = None
        self.v: A = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: H = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: F = None
        self.w: F = None
        self.v: H = None
        self.x: H = None
        self.t: H = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: D = None
        self.q: G = None
        self.x: A = None
        self.o: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.r: B = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: I = None
        self.w: A = None
        self.q: H = None
        self.y: F = None
        self.p: F = None
        self.v: A = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: H = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: F = None
        self.w: F = None
        self.v: H = None
        self.x: H = None
        self.t: H = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: D = None
        self.q: G = None
        self.x: A = None
        self.o: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.r: B = None
        self.p: C = None
        self.txt = txt

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

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