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.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * @author Бакытжан Манаспаев
 */
public class ProblemScanner {

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

    void solve(Scanner in, PrintWriter out) {
        int n = in.nextInt();

        if (n == 1) {
            out.println(1);
            return;
        } else if (n == 3) {
            out.println("2 1 4");
            out.println("3 5 7");
            out.println("6 9 8");
            return;
        }

        int a[][] = new int[n][n];
        int odd = 1;
        int index = n / 2;
        for (int i = 0; i < n; i++) {
            a[i][index] = odd;
            odd += 2;
        }
        for (int i = 0; i < n; i++) {
            if (i == n / 2) {
                continue;
            }
            a[index][i] = odd;
            odd += 2;
        }

        if ((n / 2) % 2 == 0) {
            int i = 0;
            int j = 0;
            while (odd <= n * n) {
                if (a[i][j] != 0) {
                    i++;
                    j = 0;
                    continue;
                }
                a[i][j] += odd;
                odd += 2;
                j++;
            }
        } else {
            for (int i = 0; i < n; i++) {
                if (odd > n * n) {
                    break;
                }
                for (int j = 0; j < n; j++) {
                    if (a[i][j] != 0) {
                        continue;
                    }
                    a[i][j] = odd;
                    odd += 2;
                }
            }
        }

        int even = 2;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (a[i][j] != 0) {
                    continue;
                }
                a[i][j] = even;
                even += 2;
            }
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
//                /out.print(a[i][j]+"\t");
                out.print(a[i][j]+" ");
            }
            out.println();
        }


    }
}