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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskECF16C solver = new TaskECF16C();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskECF16C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();

            int[][] mat = new int[n][n];

            int curr = 1;

            for (int i = 1; i <= n; i++) {
                mat[n / 2][i - 1] = curr;
                curr += 2;
            }

            for (int i = 1; i <= n; i++) {
                if (mat[i - 1][n / 2] > 0) continue;
                mat[i - 1][n / 2] = curr;
                curr += 2;
            }

            int rem = (n * n) / 2 - (2 * n) + 2;
            int evens = (n * n) / 2;
            int e = 2;

            for (int r = 0; r <= n / 2; r++) {
                for (int c = 0; c <= n / 2; c++) {
                    if (mat[r][c] == 0 && rem > 0) {
                        mat[r][c] = curr;
                        curr += 2;
                        mat[n - 1 - r][c] = curr;
                        curr += 2;
                        mat[r][n - 1 - c] = curr;
                        curr += 2;
                        mat[n - 1 - r][n - 1 - c] = curr;
                        curr += 2;
                        rem -= 4;
                    }
                    if (mat[r][c] == 0 && evens > 0) {
                        mat[r][c] = e;
                        e += 2;
                        mat[n - 1 - r][c] = e;
                        e += 2;
                        mat[r][n - 1 - c] = e;
                        e += 2;
                        mat[n - 1 - r][n - 1 - c] = e;
                        e += 2;
                        evens -= 4;
                    }
                }
            }

            for (int r = 0; r < n; r++) {
                for (int c = 0; c < n; c++) {
                    out.print(mat[r][c]);
                    if (c == n - 1) {
                        out.println();
                    } else {
                        out.print(" ");
                    }
                }
            }
        }

    }
}