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() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  cin >> n;
  long long g = 1, c = 2, d = ((n + 1) / 2), e = ((n + 1) / 2);
  if (n == 1) {
    cout << 1 << "\n";
    return 0;
  }
  vector<vector<long long>> v;
  for (long long i = 1; i <= ((n + 1) / 2); i++) {
    vector<long long> temp;
    for (long long j = 1; j <= n; j++) {
      if (j >= d && j <= e) {
        temp.push_back(1);
        cout << g << " ";
        g += 2;
      } else {
        temp.push_back(0);
        cout << c << " ";
        c += 2;
      }
    }
    cout << "\n";
    d--, e++;
    v.push_back(temp);
  }
  for (long long i = v.size() - 2; i >= 0; i--) {
    for (long long j = 0; j < n; j++) {
      if (v[i][j] == 1) {
        cout << g << " ";
        g += 2;
      } else {
        cout << c << " ";
        c += 2;
      }
    }
    cout << "\n";
  }
  return 0;
}