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:

def find(n,r,c):
    if r<=c and r+c<n:
        return 0,1
    elif r+c>=n and r<c:
        return 1,0
    elif r>=c and r+c>n:
        return 0,-1
    elif r+c<=n and r>c:
        return -1,0
    else:
        return 0,0

a=input()-1
c=[[0]*(a+1) for _ in xrange((a+1))]

b=range(2,(a+1)**2+1)
c[(a+1)/2][(a+1)/2]=1
i,j=(a-1)/2,(a-1)/2

while(a!=0):

    c[i][j]=b[0]
    e=find(a,i,j)
    i=i+e[0]
    j=j+e[1]

    b.remove(b[0])

    if c[i][j]!=0:
        if i==0:
            break
        b.append(b[0])
        b=b[1:]
        i-=1
        j-=1

for i in range(a+1):
    for j in range(a+1):
        print c[i][j],
    print