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;
const double PI = acos(-1.0);
const int inf = int(1e9);
const int MAX = 26;
const int mod = 10007;
int n, a[50][50];
int main() {
  while (~scanf("%d", &(n))) {
    memset(a, 0, sizeof(a));
    for (long long(i) = (1); (i) <= (n / 2 + 1); (i)++) {
      int l, r;
      l = (n + 1) / 2 - (i - 1);
      r = (n + 1) / 2 + (i - 1);
      for (long long(j) = (l); (j) <= (r); (j)++) {
        a[i][j] = a[n + 1 - i][j] = 1;
      }
    }
    int odd = 1;
    int even = 2;
    for (long long(i) = (1); (i) <= (n); (i)++) {
      for (long long(j) = (1); (j) <= (n); (j)++) {
        if (j != 1) putchar(' ');
        if (a[i][j] == 1) {
          cout << odd;
          odd += 2;
        } else {
          cout << even;
          even += 2;
        }
      }
      putchar('\n');
    }
  }
}