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;
  cin >> n;
  if (n == 1)
    cout << 1 << endl;
  else {
    int b = 1;
    int a[n + 1][n + 1];
    int t = 1;
    int i = n / 2;
    int j = n / 2;
    for (int i = 0; i <= n; i++)
      for (int j = 0; j <= n; j++) a[i][j] = 0;
    a[n / 2][n / 2] = t;
    t++;
    i--;
    j--;
    string m = "r";
    while (t <= n * n) {
      if (b % 2 != 0) {
        int y = n / 2 - i;
        int co = 0;
        while (co < y * 2) {
          a[i][j] = t;
          i++;
          t++;
          co++;
        }
        y = n / 2 - j;
        co = 0;
        while (co < y * 2) {
          a[i][j] = t;
          j++;
          t++;
          co++;
        }
        y = i - n / 2;
        co = 0;
        while (co < y * 2) {
          a[i][j] = t;
          i--;
          t++;
          co++;
        }
        y = j - n / 2;
        co = 0;
        while (co < y * 2) {
          a[i][j] = t;
          j--;
          t++;
          co++;
        }
        b++;
        j--;
      } else {
        a[i][j] = t;
        i--;
        t++;
        int y = n / 2 - j;
        int co = 0;
        while (co < y * 2) {
          a[i][j] = t;
          j++;
          t++;
          co++;
        }
        y = n / 2 - i;
        co = 0;
        while (co < y * 2) {
          a[i][j] = t;
          i++;
          t++;
          co++;
        }
        y = j - n / 2;
        co = 0;
        while (co < y * 2) {
          a[i][j] = t;
          j--;
          t++;
          co++;
        }
        y = i - n / 2;
        co = 1;
        while (co < y * 2) {
          a[i][j] = t;
          i--;
          t++;
          co++;
        }
        b++;
        i--;
        i--;
        j--;
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) cout << a[i][j] << " ";
      cout << endl;
    }
  }
}