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:
def table(n,i):
    if n==1:
        print(1, end=" ")
        return
    k = (n+1)//2
    p = (n-2)**2
    if k%2==0:
        if i==0:
            for m in range(p+1, p+1+n):
                print(m, end=" ")
        elif i==n-1:
            for m in range(n*n-n, n*n):
                print(m, end=" ")
        else:
            print(p+n+i, end=" ")
            table(n-2,i-1)
            if i==1:
                print(n**2, end=" ")
            else:
                print(p+n+i+n-3, end=" ")
    else:
        if i==0:
            for m in range(p+2, p+2+n):
                print(m, end=" ")
        elif i==n-1:
            for m in range(n*n-n+1, n*n+1):
                print(m, end=" ")
        else:
            print(p+n+i+1, end=" ")
            table(n-2,i-1)
            if i==1:
                print(p+1, end=" ")
            else:
                print(p+n+i+n-2, end=" ")
        

n = int(input())
for i in range(0,n):
    table(n,i)
    print()