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 = int(raw_input())
m = n // 2
g = [ [ None for c in range(n) ] for r in range(n) ]
g[m][m] = n * n
step = 1
dr, dc = [ -1, 0, 1, 0 ], [ 0, 1, 0, -1 ]
for i in range(m - 1, -1, -1):
    v = 0
    r, c = m, i
    while g[r][c] == None:
        g[r][c] = step
        step += 1
        R, C = r + dr[v], c + dc[v]
        if R < i or R >= n - i or C < i or C >= n - i:
            v = (v + 1) % 4
            R, C = r + dr[v], c + dc[v]
        r, c = R, C
for row in g:
    #pattern = map(lambda x: x % 2, row)
    #print(' '.join(map(str, pattern)))
    print(' '.join(map(str, row)))