class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: I = None
        self.p: D = None
        self.z: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: C = None
        self.x: H = None
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: F = None
        self.p: J = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: C = None
        self.u: G = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: C = None
        self.x: H = None
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: F = None
        self.p: J = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: C = None
        self.u: G = None
        self.v: E = None
        self.txt = txt

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

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

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