human
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
 ... Give me a Python code to 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?
assistant
#Here is Python code to 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.

#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def solve(n):
    if n == 1:
        return [[1]]

    sol = [[0] * n for _ in range(n)]

    sub_sol = solve(n - 2)
    for i in range(n - 2):
        for j in range(n - 2):
            sol[i + 1][j + 1] = sub_sol[i][j]

    for i in range(n - 2):
        sol[0][i + 1] = (n - 2) ** 2 + 2 * i + 2
        sol[-1][i + 1] = (n - 2) ** 2 + 2 * (n - 2 + i) + 2

    for i in range(n - 3):
        sol[i + 2][0] = (n - 2) ** 2 + 2 * i + 1
        sol[i + 2][-1] = (n - 2) ** 2 + 2 * (n - 3 + i) + 1

    sol[1][0] = n ** 2 - 2
    sol[1][-1] = n ** 2

    sol[0][0] = n ** 2 - 1
    sol[0][-1] = n ** 2 - 3
    sol[-1][0] = n ** 2 - 5
    sol[-1][-1] = n ** 2 - 7

    return sol

def main():
    n = int(input())

    for row in solve(n):
        print(*row)

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def...