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
#sys.stdin=open("data.txt")
input=sys.stdin.readline

"""
1
0 extra

010
111
010
0 extra

10101
00100
11111
00100
10101
1 extra

1111111
0001000
0001000
1111111
0001000
0001000
1111111
3 extra pairs

each pair adds 4 to the odd number count
2n-1 is the plus
(n^2+1)/2 is the number of wanted odd numbers
(n^2+1)/2-2n+1
(n^2-4n+3)/2

so (n-3)(n-1)/8 is the number of wanted extra pairs
"""

n=int(input())
extra=((n-1)*(n-3))//8

# make grid
g=[[0]*n for _ in range(n)]

# make plus
for i in range(n):
    g[i][(n-1)//2]=1
    g[(n-1)//2][i]=1

# make extra
for i in range((n-1)//2):
    for j in range((n-1)//2):
        if extra==0: break
        g[i][j]=1
        g[n-1-i][j]=1
        g[i][n-1-j]=1
        g[n-1-i][n-1-j]=1
        extra-=1
    if extra==0: break

# now replace
r0=2
r1=1
for i in range(n):
    for j in range(n):
        if g[i][j]:
            g[i][j]=r1
            r1+=2
        else:
            g[i][j]=r0
            r0+=2

# print
for i in range(n):
    print(" ".join(map(str,g[i])))
    pass