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.util.*;
import java.io.*;

public class Solution710C {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        PrintWriter pw = new PrintWriter(System.out);

        if (n == 1) {
            pw.println("1");
            pw.close();
            return;
        }

        int up = 0;
        int odd = 1;
        int even = 2;
        int total = n * n;
        StringBuilder sb = new StringBuilder();

        while (up < n && odd <= total) {
            int left = Math.abs(n / 2 - up);
            int right = n - left;
            for (int j = 0; j < n; j++) {
                if (j >= left && j < right) {
                    sb.append(odd);
                    sb.append(" ");
                    odd += 2;
                } else {
                    sb.append(even);
                    sb.append(" ");
                    even += 2;
                }
            }
            sb.append("\n");
            up++;
        }
        pw.println(sb.toString());
        pw.close();
    }
}