class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: D = None
        self.r: I = None
        self.q: F = None
        self.z: B = None
        self.x: J = None
        self.t: J = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.o: C = None
        self.w: H = None
        self.p: I = None
        self.q: E = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: F = None
        self.r: I = None
        self.q: C = None
        self.o: H = None
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.u: H = None
        self.v: B = None
        self.p: A = None
        self.z: C = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: C = None
        self.s: F = None
        self.p: A = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: B = None
        self.q: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.o: C = None
        self.w: H = None
        self.p: I = None
        self.q: E = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: F = None
        self.r: I = None
        self.q: C = None
        self.o: H = None
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.u: H = None
        self.v: B = None
        self.p: A = None
        self.z: C = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: C = None
        self.s: F = None
        self.p: A = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: B = None
        self.q: H = None
        self.txt = txt

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

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

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