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

Solution:
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    static void solve(Scanner in, PrintWriter out) {
        int n = in.nextInt();
        int ecount = 2;
        int necount = 1;
        int middle = (n + 1) / 2;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                int x = (j + 1 > middle) ? n - j : j + 1;
                int y = (i + 1 > middle) ? n - i : i + 1;
                if (x + y > middle) {
                    out.print(necount);
                    necount += 2;
                }
                else {
                    out.print(ecount);
                    ecount += 2;
                }
                out.print(' ');
            }
            out.println();
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve (in, out);
        out.flush();
    }
}