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
n = int(raw_input())
a = list([] for i in range(1,n+2))
#print a
m = (n+1)/2
odd = 1
eve = 1
for i in range(1, (n+1)/2+1):
    for j in range(1,n+1):
        l = (2*(i-1)+1)/2
        if(j<m-l or j>m+l):
            a[i].append(2*eve)
            eve+=1
        else:
            a[i].append(2*odd-1)
            odd+=1
num = m-1
##print a
for i in range((n+1)/2+1,n+1):
    #print i
    for j in range(1,n+1):
        l = (2*num-1)/2
        ##print l
        if(j<m-l or j>m+l):
            ##print j,m,l
            a[i].append(2*eve)
            eve+=1
        else:
            ##print "ok"
            a[i].append(2*odd-1)
            odd+=1
    num-=1
#print a
for i in range(1,n+1):
    for j in range(n):
        print a[i][j],
    print ""