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:
import math
import re

n = int(input())

arr = [[0] * n for i in range(n)]

a = [1] + [1 + 2*i for i in range(1, n*n//2+1)]
b = [2*i for i in range(1, n*n//2 + 1)]


k = 0

for i in range(n//2+1):
    for j in range(n//2-i, n//2 + i + 1):
        arr[i][j] = a[k]
        k += 1

for i in range(n // 2):
    for j in range(i + 1, n - i - 1):
        arr[n // 2 + 1 + i][j] = a[k]
        k += 1

k = 0

for i in range(n):
    for j in range(n):
        if arr[i][j] == 0:
            arr[i][j] = b[k]
            k += 1


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




# arr = list(map(int, input().split()))
# m = int(input())
# spis = list(map(int, input().split()))
#
# arr1 = sorted(arr, reverse=True)
# a = [n - arr1.index(arr[el - 1]) for el in spis]
# print(' '.join(map(str, a)))