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 TaskC{
  public static void main(String[] args) {
    TaskC tC = new TaskC();
    PrintWriter pw = new PrintWriter(System.out);
    tC.solve(new Scanner(System.in), pw);
    pw.close();
  }

  public void solve(Scanner input, PrintWriter output) {
    int n = input.nextInt();
    int[][] result = new int[n][n];
    int count = 2;
    int lcol = 0;
    int rcol = n - 1;
    int trow = 0;
    int brow = n - 1;
    while (lcol < rcol) {
      int tr = trow;
      int br = brow;
      while (tr < br && count < n * n) {
        result[tr][lcol] = count;
        count += 2;
        result[tr][rcol] = count;
        count += 2;
        result[br][lcol] = count;
        count += 2;
        result[br][rcol] = count;
        count += 2;
        tr++;
        br--;
      }
      trow++;
      brow--;
      lcol++;
      rcol--;
    }
    count = 1;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (result[i][j] == 0) {
          result[i][j] = count;
          count += 2;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        output.print(result[i][j] + " ");
      }
      output.println();
    }
  }
}