class A:
    def __init__(self, txt: str):
        self.r: J = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: G = None
        self.o: B = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: G = None
        self.o: B = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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