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 PYTHON3):

Solution:
n=int(input())
matrix=[[0]*n for i in range(n)]
ans=[[0]*n for i in range(n)]
a=(n*n)//2
lis=[]
for i in range(a+1):
    lis.append((2*i)+1)
for i in range(a):
    lis.append(2*(i+1))
j=0
x=n//2
y=x+1
for i in range(n):
    if i<=n//2:
        for k in range(x,y):
            ans[i][k]=lis[j]
            matrix[i][k]=1
            j+=1
        if i!=n//2:
            x-=1
            y+=1
    else:
        x+=1
        y-=1
        for k in range(x,y):
            ans[i][k]=lis[j]
            matrix[i][k]=1
            j+=1
for i in range(n):
    for k in range(n):
        if matrix[i][k]==0:
            ans[i][k]=lis[j]
            j+=1
for i in range(n):
    print(" ".join(str(x) for x in ans[i]))