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;
void debug_out() { cerr << endl; }
template <class T>
ostream& prnt(ostream& out, T v) {
  out << v.size() << '\n';
  for (auto e : v) out << e << ' ';
  return out;
}
template <class T>
ostream& operator<<(ostream& out, vector<T> v) {
  return prnt(out, v);
}
template <class T>
ostream& operator<<(ostream& out, set<T> v) {
  return prnt(out, v);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, map<T1, T2> v) {
  return prnt(out, v);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> p) {
  return out << '(' << p.first << ' ' << p.second << ')';
}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << H;
  debug_out(T...);
}
int n;
int dist(int a, int b, int c, int d) { return abs(a - c) + abs(b - d); }
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  int p = 2, imp = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; ++j) {
      int k = dist(i, j, n / 2, n / 2) <=
              dist(i, j, (i >= n / 2) * (n - 1), (j >= n / 2) * (n - 1));
      if (k) {
        cout << imp << ' ';
        imp += 2;
      } else {
        cout << p << ' ';
        p += 2;
      }
    }
    cout << '\n';
  }
}