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)]

for i in range(n):
    matrix[i][n-1-i]=int((n*n-n+2)/2)+i

p=1
sx=0
sy=n-2
x=0
y=n-2
j=0
while p!=int((n*n-n+2)/2):
    if y!=j:
        matrix[x][y]=p
        matrix[n-1-x][n-1-y]=n*n+1-p
        p+=1
        y-=1
    elif x+y!=n-1:
        matrix[x][y]=p
        matrix[n-1-x][n-1-y]=n*n+1-p
        p+=1
        x+=1
    elif x+y==n-1:
        x=sx+1
        y=sy-1
        sx+=1
        sy-=1
        j+=1


for i in range(n):
    for j in range(n):
        print(matrix[i][j],end="")
        if j!=n-1:
            print(" ",end="")
    print("\n",end="")