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:
def solve():
    n = int(input())
    if n == 1:
        print(1)
        return
    b = [[False for i in range(n)] for j in range(n)]
    m = n // 2
    en = (n ** 2) // 2
    for i in range(m):
        for j in range(m):
            b[i][j] = True
            b[i][2 * m - j] = True
            b[2 * m - i][j] = True
            b[2 * m - i][2 * m - j] = True
            en -= 4
            if en == 0:
                break
        if en == 0:
            break
    o = 1
    e = 2
    a = [['0' for i in range(n)] for j in range(n)]
    for i in range(n):
        for j in range(n):
            if b[i][j]:
                a[i][j] = str(e)
                e += 2
            else:
                a[i][j] = str(o)
                o += 2
    for i in range(n):
        print(' '.join(a[i]))


def main():
    solve()


if __name__ == '__main__':
    main()