n = input('Input an integer(from 1 to 10, inclusive): ')
N = 2*n+1
a = [ [ 0 for _ in range(N) ] for _ in range(N) ]
r, c, now = 0, n, 1
while now <= N*N:
a[r][c] = now
if now % N == 0:
r = (r + 1) % N
else:
r -= 1
c = (c + 1) % N
now += 1
for r in range(N):
for c in range(N):
print('%4d' % a[r][c]),
print
biA9IGlucHV0KCdJbnB1dCBhbiBpbnRlZ2VyKGZyb20gMSB0byAxMCwgaW5jbHVzaXZlKTogJykKTiA9IDIqbisxCmEgPSBbIFsgMCBmb3IgXyBpbiByYW5nZShOKSBdIGZvciBfIGluIHJhbmdlKE4pIF0KciwgYywgbm93ID0gMCwgbiwgMQp3aGlsZSBub3cgPD0gTipOOgogIGFbcl1bY10gPSBub3cKICBpZiBub3cgJSBOID09IDA6CiAgICByID0gKHIgKyAxKSAlIE4KICBlbHNlOgogICAgciAtPSAxCiAgICBjID0gKGMgKyAxKSAlIE4KICBub3cgKz0gMQpmb3IgciBpbiByYW5nZShOKToKICBmb3IgYyBpbiByYW5nZShOKToKICAgIHByaW50KCclNGQnICUgYVtyXVtjXSksCiAgcHJpbnQ=