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

Solution:
#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int ar[n][n];
  for (int k = 0; k < n; k++) {
    for (int l = 0; l < n; l++) {
      ar[k][l] = 0;
    }
  }
  if (n % 2 != 0) {
    int c = n / 2;
    int r = 0;
    for (int i = 1; i <= n * n; i++) {
      if (r < 0) {
        r = n + r;
      }
      if (c > n - 1) {
        c = c - n;
      }
      if (ar[r][c] != 0) {
        c = c - 1;
        r = r + 2;
        if (r > n) {
          r = r - n;
        }
        if (c < 0) {
          c = n + c;
        }
        ar[r][c] = i;
      } else {
        ar[r][c] = i;
      }
      r -= 1;
      c += 1;
    }
  }
  for (int k = 0; k < n; k++) {
    for (int l = 0; l < n; l++) {
      if (n * n < 10)
        printf("%d ", ar[k][l]);
      else if (n * n < 100)
        printf("%2.d ", ar[k][l]);
      else if (n * n < 1000)
        printf("%3.d ", ar[k][l]);
      else if (n * n < 10000)
        printf("%4.d ", ar[k][l]);
    }
    printf("\n");
  }
  return 0;
}