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:
from sys import exit

n = int(input())

if n == 1:
    print(1)
    exit(0)

odd = iter(range(1, n*n+1, 2))
even = iter(range(2, n*n+1, 2))

result = []
for _ in range(n):
    result.append([None] * n)


for i in range(n):
    result[n//2][i] = next(odd)

offset = 1
length = n - 2
for i in range(n//2):
    for j in range(offset, offset + length):
        result[i][j] = next(odd)
        result[-1-i][j] = next(odd)
    offset += 1
    length -= 2

for i in range(n):
    for j in range(n):
        if result[i][j] is None:
            result[i][j] = next(even)


for i in range(n):
    print(' '.join(map(str, result[i])))

# 2 7 4
# 1 3 5
# 6 9 8

#    11 13 15
#       23
# 1  3  5  7  9
#       25
#    17 19 21

#    15 17 19 21 23
#       35 37 39
#          47
# 1  3  5  7  9  11 13
#          49
#       41 43 45
#    25 27 29 31 33