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

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.t: E = None
        self.x: I = None
        self.v: A = None
        self.q: F = None
        self.u: F = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: B = None
        self.p: A = None
        self.v: I = None
        self.q: J = None
        self.r: G = None
        self.s: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: A = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.p: G = None
        self.w: C = None
        self.o: B = None
        self.r: B = None
        self.y: C = None
        self.txt = txt

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

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

n.r = d
n.p = d
n.t = d
n.x = g
n.y = g
n.o = i
n.s = i
n.q = e
n.u = j
e.s = c
e.t = g
e.x = b
e.v = n
e.q = i
e.u = i
e.z = k
k.p = n
k.v = n
h.o = j
h.w = e
h.p = n
h.s = n
h.v = b
h.q = c
h.r = d
g.r = h
i.o = d
i.z = j
i.w = j
i.y = g
d.x = g
d.s = g
d.o = n
d.w = i
d.t = c
d.y = k
j.t = d
j.r = n
j.w = i
b.q = e
b.o = e
b.r = e
b.x = k
b.w = k
b.y = k
b.p = d
c.q = d
c.y = n
c.v = n
c.r = n
c.x = g
c.s = i
c.u = i
c.t = b
c.p = k
assert k.p.x.r.r.w.z.w.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: E = None
        self.y: E = None
        self.p: G = None
        self.o: F = None
        self.q: B = None
        self.u: H = None
        self.s: F = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.t: E = None
        self.x: I = None
        self.v: A = None
        self.q: F = None
        self.u: F = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: B = None
        self.p: A = None
        self.v: I = None
        self.q: J = None
        self.r: G = None
        self.s: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: A = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.p: G = None
        self.w: C = None
        self.o: B = None
        self.r: B = None
        self.y: C = None
        self.txt = txt

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

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

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