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 PYTHON):

Solution:
n = input()
M = [[-1] * n for _ in xrange(n)]

ix = 0
odds = [i for i in xrange(1, n*n+1) if i & 1]
evens = [i for i in xrange(1, n*n+1) if not (i & 1)]

for i in xrange(n):
    M[n/2][i] = odds.pop()
    if i != n/2:
        M[i][n/2] = odds.pop()

col_left, col_right = n/2-1, n/2+1
row_up, row_down = n/2-1, n/2+1
while odds:
    assert len(odds) % 4 == 0
    if row_up < 0:
        row_up, row_down = n/2-1, n/2+1
        col_left -= 1
        col_right += 1
    M[row_up][col_left] = odds.pop()
    M[row_up][col_right] = odds.pop()
    M[row_down][col_left] = odds.pop()
    M[row_down][col_right] = odds.pop()
    row_up -= 1
    row_down += 1

for i in xrange(n):
    for j in xrange(n):
        if M[i][j] == -1:
            M[i][j] = evens.pop()

for row in M:
    print ' '.join(map(str, row))