n = int(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], end="")
print()
biA9IGludChpbnB1dCgnSW5wdXQgYW4gaW50ZWdlcihmcm9tIDEgdG8gMTAsIGluY2x1c2l2ZSk6ICcpKQpOID0gMipuKzEKYSA9IFsgWyAwIGZvciBfIGluIHJhbmdlKE4pIF0gZm9yIF8gaW4gcmFuZ2UoTikgXQpyLCBjLCBub3cgPSAwLCBuLCAxCndoaWxlIG5vdyA8PSBOKk46CiAgYVtyXVtjXSA9IG5vdwogIGlmIG5vdyAlIE4gPT0gMDoKICAgIHIgPSAociArIDEpICUgTgogIGVsc2U6CiAgICByIC09IDEKICAgIGMgPSAoYyArIDEpICUgTgogIG5vdyArPSAxCmZvciByIGluIHJhbmdlKE4pOgogIGZvciBjIGluIHJhbmdlKE4pOgogICAgcHJpbnQoJyU0ZCcgJSBhW3JdW2NdLCBlbmQ9IiIpCiAgcHJpbnQoKQ==