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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.t: A = None
        self.q: H = None
        self.s: G = None
        self.r: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: J = None
        self.w: E = None
        self.r: B = None
        self.p: F = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: B = None
        self.o: B = None
        self.w: D = None
        self.v: F = None
        self.y: E = None
        self.u: E = None
        self.s: D = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: H = None
        self.x: E = None
        self.o: J = None
        self.t: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: E = None
        self.o: I = None
        self.w: I = None
        self.p: H = None
        self.r: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.t: A = None
        self.q: H = None
        self.s: G = None
        self.r: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: J = None
        self.w: E = None
        self.r: B = None
        self.p: F = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: B = None
        self.o: B = None
        self.w: D = None
        self.v: F = None
        self.y: E = None
        self.u: E = None
        self.s: D = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: H = None
        self.x: E = None
        self.o: J = None
        self.t: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: E = None
        self.o: I = None
        self.w: I = None
        self.p: H = None
        self.r: G = None
        self.txt = txt

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

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