Problem: Find an n × n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd.

Input

The only line contains odd integer n (1 ≤ n ≤ 49).

Output

Print n lines with n integers. All the integers should be different and from 1 to n2. The sum in each row, column and both main diagonals should be odd.

Examples

Input

1


Output

1


Input

3


Output

2 1 4
3 5 7
6 9 8

Solution (in PYTHON):

Solution:
#from math import *
#from collections import Counter
def rl(s): return xrange(len(s))

INF = 2147483647


import sys
stdin = sys.stdin

N = int(stdin.readline().strip())

from copy import deepcopy
def makeTable(init, *dims):
    if 0 == len(dims): return deepcopy(init)
    return [makeTable(init, *dims[1:]) for i in xrange(dims[0])]

t = makeTable(0, N, N)

rem = (N**2 + 1) // 2
for y in range(N):
    t[N//2][y] = 1
for x in range(N):
    t[x][N//2] = 1

rem -= 2*N - 1

f = rem // 4
for x in range(N//2):
    for y in range(N//2):
        if f <= 0: break
        t[x][y] = 1
        t[N-1-x][y] = 1
        t[N-1-x][N-1-y] = 1
        t[x][N-1-y] = 1
        f -= 1

odds = range(1, N**2+1, 2)
evens = range(2, N**2, 2)

for x in range(N):
    for y in range(N):
        if t[x][y] == 1:
            v = odds.pop()
        else:
            v = evens.pop()
        print v,
    print ""