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 int INF = int(1e9);
const int MOD = int(1e9) + 7;
const long long N = 1000010;
const long long INFll = 1ll * INF * INF;
const long double ldINF = 1e+018;
const long double EPS = 0.000000001;
const int sdx[4] = {-1, 0, 1, 0};
const int sdy[4] = {0, 1, 0, -1};
const long double PI = 3.1415926535897932384;
template <typename T>
ostream& operator<<(ostream& out, pair<T, T>& a) {
  out << a.first << " " << a.second;
  return out;
}
template <typename T>
istream& operator>>(istream& in, pair<T, T>& a) {
  in >> a.first >> a.second;
  return in;
}
template <typename T>
istream& operator>>(istream& in, vector<T>& a) {
  for (int i = 0; i < a.size(); ++i) in >> a[i];
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> a) {
  for (int i = 0; i < a.size(); ++i)
    if (i == a.size() - 1)
      out << a[i];
    else
      out << a[i] << " ";
  return out;
}
int a[50][50];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int k1 = 1, k2 = 2;
  for (int i = 0; i < n; i++) a[i][n / 2] = k1, k1 += 2;
  if (k1 < n * n)
    for (int i = 0; i < n; i++)
      if (!a[n / 2][i]) a[n / 2][i] = k1, k1 += 2;
  int cur = 0;
  while (k1 < n * n) {
    for (int i = 0; i < n && k1 < n * n; i++)
      if (!a[i][cur] && !a[i][n - 1 - cur] && cur != i && cur + i != n - 1) {
        a[i][cur] = k1;
        k1 += 2;
        a[i][n - cur - 1] = k1;
        k1 += 2;
      }
    cur++;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (!a[i][j]) a[i][j] = k2, k2 += 2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << a[i][j] << ' ';
    cout << endl;
  }
  if (0)
    cerr << fixed << setprecision(0)
         << "TIME = " << clock() / (long double)CLOCKS_PER_SEC * 1000 << "\n";
  return 0;
}