class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: F = None
        self.q: G = None
        self.o: F = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: H = None
        self.w: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: F = None
        self.p: F = None
        self.r: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: B = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: E = None
        self.p: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: H = None
        self.w: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: F = None
        self.p: F = None
        self.r: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: B = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: E = None
        self.p: H = None
        self.txt = txt

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

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