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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: F = None
        self.y: D = None
        self.s: D = None
        self.r: D = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: F = None
        self.y: D = None
        self.s: D = None
        self.r: D = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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