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:
n = int(input())

def rec(x):
    if x == 1:
        return [[1]]
    else:
        tmp = [[0] * x for i in range(x)]
        ins = rec(x - 2)
        for i in range(0, x):
            tmp[0][i] = i % 2
            tmp[x - 1][i] = i % 2
            tmp[i][0] = i % 2
            tmp[i][x - 1] = i % 2
        sum = 0
        for i in tmp[0]:
            sum += i
        if sum % 2 == 0:
            for i in range(0, x):
                tmp[0][i] = 1 - i % 2
                tmp[x - 1][i] = 1 - i % 2
                tmp[i][0] = 1 - i % 2
                tmp[i][x - 1] = 1 - i % 2
        for i in range(1, x - 1):
            for j in range(1, x - 1):
                tmp[i][j] = ins[i - 1][j - 1]
        return tmp


def extract_same(ch):
    global num
    for i in num:
        if i % 2 == ch:
            result = i
            num.remove(i)
            return result

num = {i for i in range(1, n ** 2 + 1)}
mask = rec(n)
for i in range(0, n):
    for j in range(0, n):
        print(extract_same(mask[i][j]), end=' ')
    print(end='\n')