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>
using namespace std;
int main() {
  int n, i, e, o, j, k, c = 0, r = 1;
  cin >> n;
  int a[n][n];
  memset(a, -1, sizeof(a));
  for (k = n / 2; k >= 0; k--) {
    for (i = 0; i < (2 * c + 1); i++) {
      a[n / 2 - k][k + i] = r;
      r = r + 2;
    }
    c++;
  }
  c = 0;
  for (k = 1; k <= n / 2; k++) {
    for (i = n - 3; i >= 2 * c; i--) {
      a[n / 2 + k][k + n - 3 - i] = r;
      r = r + 2;
    }
    c++;
  }
  r = 2;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (a[i][j] == -1) {
        a[i][j] = r;
        r = r + 2;
      }
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) cout << a[i][j] << " ";
    cout << endl;
  }
}