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 sys

n = int(input())


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

A = [[0] * n for _ in range(n)]

for i in range(n):
    A[i][n // 2] = odd.pop()

for i in range(n):
    if i != n // 2:
        A[n // 2][i] = odd.pop()

n_off = (n + 1) // 2

for p in range(2):
    for q in range(2):
        even_to_spend = ((n // 2) * (n + 1) // 2) // 2
        for i in range(n // 2):
            for j in range(n // 2):
                if even_to_spend > 0:
                    even_to_spend -= 1
                    A[i + p * n_off][j + q * n_off] = even.pop()
                else:
                    A[i + p * n_off][j + q * n_off] = odd.pop()

for i in range(n):
    for j in range(n):
        print(A[i][j], end=' ')
    print()