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 double _PI = 3.141592653589793115997963468544185161590576171875;
const long double TTT = 1.000000011;
const long long base = 1000 * 1000 * 1000 + 7;
template <typename T>
inline T min(T &x, T &y) {
  return x > y ? y : x;
}
template <typename T>
inline T max(T &x, T &y) {
  return x > y ? x : y;
}
template <typename T>
inline T _min(T &x, T y) {
  return x > y ? x = y : x;
}
inline long double abs(const pair<long long, long long> &x) {
  return sqrt(1.0 * (x.first * x.first) + 1.0 * (x.second * x.second));
}
int main() {
  long long n;
  cin >> n;
  vector<vector<long long> > v(n, vector<long long>(n, 0));
  long long k = n * n / 2 + 1;
  for (long long i = 0; i < n; ++i) {
    v[n / 2][i] = 1;
    v[i][n / 2] = 1;
    k -= 2;
  }
  k++;
  {
    for (long long i = 0; i * (i + 1) / 2 < k / 4; ++i) {
      for (long long j = 0; j <= i; ++j) {
        v[i][j] = v[n - 1 - i][n - 1 - j] = v[n - 1 - i][j] = v[i][n - 1 - j] =
            1;
      }
    }
  }
  long long p = 1, o = 2;
  for (long long i = 0; i < n; ++i) {
    for (long long j = 0; j < n; ++j) {
      if (v[i][j]) {
        cout << ((v[i][j] = p)) << ' ';
        p += 2;
      } else {
        cout << ((v[i][j] = o)) << ' ';
        o += 2;
      }
    }
    cout << endl;
  }
  return 0;
}