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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: D = None
        self.y: I = None
        self.o: G = None
        self.s: A = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: B = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: G = None
        self.q: I = None
        self.o: A = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: C = None
        self.r: H = None
        self.y: H = None
        self.v: F = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: I = None
        self.u: A = None
        self.p: F = None
        self.txt = txt

n = A("n")
m = B("m")
c = C("c")
i = D("i")
k = E("k")
g = F("g")
f = G("f")
j = H("j")
a = I("a")
h = J("h")

n.z = i
n.w = j
n.y = h
n.r = h
n.p = g
n.t = g
n.s = c
n.x = c
n.v = c
m.v = k
m.w = k
m.p = i
m.y = a
m.o = f
m.s = n
c.z = f
c.q = m
c.p = n
i.y = g
i.p = f
i.q = a
i.o = n
i.u = j
k.x = g
k.v = g
k.z = c
k.r = j
k.y = j
k.s = m
g.s = k
g.w = j
g.o = j
f.y = k
f.r = n
j.w = n
j.p = c
j.u = m
j.z = a
j.v = f
j.x = g
a.x = k
a.z = k
a.y = c
a.t = f
a.w = f
a.o = h
h.s = j
h.t = a
h.u = n
h.p = g
assert j.w.p.s.r.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: H = None
        self.y: J = None
        self.p: F = None
        self.r: J = None
        self.t: F = None
        self.s: C = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: D = None
        self.y: I = None
        self.o: G = None
        self.s: A = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: B = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: G = None
        self.q: I = None
        self.o: A = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: C = None
        self.r: H = None
        self.y: H = None
        self.v: F = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: I = None
        self.u: A = None
        self.p: F = None
        self.txt = txt

n = A("n")
m = B("m")
c = C("c")
i = D("i")
k = E("k")
g = F("g")
f = G("f")
j = H("j")
a = I("a")
h = J("h")

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