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

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

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.x: F = None
        self.z: A = None
        self.t: D = None
        self.y: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: E = None
        self.q: D = None
        self.y: I = None
        self.z: B = None
        self.u: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.o: F = None
        self.r: H = None
        self.s: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.x: I = None
        self.q: A = None
        self.z: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.x: F = None
        self.z: A = None
        self.t: D = None
        self.y: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: E = None
        self.q: D = None
        self.y: I = None
        self.z: B = None
        self.u: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.o: F = None
        self.r: H = None
        self.s: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.x: I = None
        self.q: A = None
        self.z: I = None
        self.txt = txt

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

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