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>
#pragma GCC optimize("Ofast", "O3", "unroll-loops", "omit-frame-pointer", \
                     "inline")
#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4", "popcnt", "abm", \
                   "mmx", "avx", "avx2")
#pragma GCC option("tune = native", "arch = native", "no-zero-upper")
#pragma comment(linker, "/stack:200000000")
using namespace std;
inline void cringe() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
template <typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& p) {
  in >> p.first >> p.second;
  return in;
}
template <typename T>
istream& operator>>(istream& in, vector<T>& v) {
  for (size_t i = 0; i < (v.size()); ++i) in >> v[i];
  return in;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2> p) {
  out << p.first << ' ' << p.second;
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, const vector<T> v) {
  if (v.size()) {
    out << v[0];
    if (strlen(typeid(T).name()) == 1)
      for (size_t i = (1); i < (v.size()); ++i) out << ' ' << v[i];
    else
      for (size_t i = (1); i < (v.size()); ++i) out << '\n' << v[i];
  }
  return out;
}
bool f(size_t i, size_t j, size_t n) {
  return (i + j >= n / 2) && ((int)(j - i) <= (int)(n / 2)) &&
         ((int)(j - i) >= -(int)(n / 2)) && (i + j <= n + n / 2 - 1);
}
void solve(size_t test) {
  for (size_t o = 0; o < (test); ++o) {
    size_t n;
    cin >> n;
    vector<vector<int> > ans(n, vector<int>(n));
    int a = -1, b = 0;
    for (size_t i = 0; i < (n); ++i) {
      for (size_t j = 0; j < (n); ++j) ans[i][j] = f(i, j, n) ? a += 2 : b += 2;
    }
    cout << ans;
  }
}
signed main() {
  cringe();
  size_t test = 1;
  solve(test);
  return 0;
}