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 long long INF = 1e9 + 7;
const int N = 1e2;
int a[N][N];
int main() {
  memset((a), (0), sizeof(a));
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) a[i][n / 2] = a[n / 2][i] = 1;
  int tot = n * n / 2 + 1;
  tot -= 2 * n - 1;
  tot /= 2;
  for (int i = 0; i < n / 2; i++) {
    int l = 0;
    int r = n - 1;
    while (l < r) {
      if (tot == 0) break;
      a[i][l] = a[i][r] = 1;
      a[n - i - 1][l] = a[n - i - 1][r] = 1;
      l++;
      r--;
      tot -= 2;
    }
  }
  int l = 1;
  int r = 2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j]) {
        cout << l << ' ';
        l += 2;
      } else {
        cout << r << ' ';
        r += 2;
      }
    }
    cout << endl;
  }
  return 0;
}