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 odd[2000], even[2000];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n * n; i += 2) {
    odd[(i - 1) / 2] = i;
  }
  for (int i = 2; i <= n * n; i += 2) {
    even[i / 2 - 1] = i;
  }
  int i = 0, k = 0;
  if (n == 3) {
    cout << "2 1 4\n";
    cout << "3 5 7\n";
    cout << "6 9 8\n";
    return 0;
  }
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < n; y++) {
      if ((n - 1) % 4 == 0) {
        if (x == y) {
          cout << odd[i++] << " ";
          continue;
        }
        if ((x < n / 2 && y > n / 2) || (x > n / 2 && y < n / 2)) {
          cout << odd[i++] << " ";
          continue;
        }
      } else {
        if (y < n / 2) {
          cout << odd[i++] << " ";
          continue;
        }
        if ((x == 0 && y < n - 2) || (x == 2 && y >= n - 2)) {
          cout << odd[i++] << " ";
          continue;
        }
      }
      cout << even[k++] << " ";
    }
    cout << "\n";
  }
  return 0;
}