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;
using ll = long long;
using ld = long double;
ll mod = 1e9;
void solveCP311() {
  ll n;
  cin >> n;
  ll arr[n][n];
  for (ll i = 0; i < n; i++) {
    for (ll j = 0; j < n; j++) {
      arr[i][j] = 0;
    }
  }
  for (ll i = 0; i < n / 2; i++) {
    ll len = n / 2 - i;
    for (ll j = 0; j < len; j++) {
      ll x1 = i, x2 = n - 1 - i;
      ll y1 = j, y2 = n - 1 - j;
      arr[x1][y1] = 1;
      arr[x1][y2] = 1;
      arr[x2][y1] = 1;
      arr[x2][y2] = 1;
    }
  }
  ll odd = 1, even = 2;
  for (ll i = 0; i < n; i++) {
    for (ll j = 0; j < n; j++) {
      if (arr[i][j]) {
        cout << even << " ";
        even += 2;
      } else {
        cout << odd << " ";
        odd += 2;
      }
    }
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll t = 1;
  while (t--) {
    solveCP311();
  }
  return 0;
}