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())
g = [[0 for _ in range(n // 2 + 1)] for _ in range(n // 2 + 1)]
e, o = list(filter(lambda x: x % 2 == 0, range(1, n*n + 1))), list(filter(lambda x: x % 2 == 1, range(1, n*n + 1)))

for k in range(n, 0, -4):
    x, y = k // 2, 0
    for _ in range(k // 2):
        g[x][y] = 1
        y += 1
    for _ in range(k - k // 2):
        g[x][y] = 1
        x -= 1

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

for i in range(n // 2 - 1, -1, -1):
    g.append(list(g[i]))

ie, io = 0, 0
for i in range(n):
    for j in range(n):
        if g[i][j] == 1:
            g[i][j] = o[io]
            io += 1
        else:
            g[i][j] = e[ie]
            ie += 1
for r in range(n):
    print(' '.join(map(str, g[r])))