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:
import sys
i=lambda:sys.stdin.readline().strip()
sys.setrecursionlimit(99999999)
ii=lambda:map(int,i().split(" "))

n=int(i())
matrix = [[0]*n for _ in xrange(n)]
k=n*n-2*n+1
for e in xrange(n):
    matrix[e][n/2]=1
    matrix[n/2][e]=1
ranges=[xrange(0,n/2,2),xrange(n/2+1,n-1,2)]
for a in ranges:
    for b in ranges:
        for e in a:
            for ee in b:
                #print e,ee,k
                if k>n*n/2 and matrix[e][ee]==0 and matrix[e+1][ee]==0 and matrix[e][ee+1]==0 and matrix[e+1][ee+1]==0:
                    matrix[e][ee]=1
                    matrix[e+1][ee]=1
                    matrix[e][ee+1]=1
                    matrix[e+1][ee+1]=1
                    k-=4
accEven,accOdd=2,1
for e in xrange(n):
    for ee in xrange(n):
        if matrix[e][ee]==1:
            print accOdd,
            accOdd+=2
        else:
            print accEven,
            accEven+=2
    print ""