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 = 0x7fffffff;
const long long INF = 0x7fffffffffffffff;
template <typename A, typename B>
ostream &operator<<(ostream &s, const pair<A, B> &p) {
  return s << "(" << p.first << "," << p.second << ")";
}
template <typename T>
ostream &operator<<(ostream &s, const vector<T> &c) {
  s << "[ ";
  for (auto it : c) s << it << " ";
  s << "]";
  return s;
}
template <typename T>
ostream &operator<<(ostream &o, const set<T> &st) {
  o << "{";
  for (auto it = st.begin(); it != st.end(); it++)
    o << (it == st.begin() ? "" : ", ") << *it;
  return o << "}";
}
template <typename T1, typename T2>
ostream &operator<<(ostream &o, const map<T1, T2> &make_pair) {
  o << "{";
  for (auto it = make_pair.begin(); it != make_pair.end(); it++) {
    o << (it == make_pair.begin() ? "" : ", ") << it->first << ":"
      << it->second;
  }
  o << "}";
  return o;
}
int t[50][50];
int n;
int main() {
  cin >> n;
  memset(t, (0), sizeof(t));
  ;
  int mid = (n + 1) / 2;
  for (int up = 0; up < mid; up++) {
    fill_n(t[up] + (mid - 1 - up), 2 * up + 1, 1);
    fill_n(t[n - 1 - up] + (mid - 1 - up), 2 * up + 1, 1);
  }
  int odd = 1, even = 2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (t[i][j])
        printf("%d ", odd), odd += 2;
      else
        printf("%d ", even), even += 2;
    }
    cout << endl;
  }
  return 0;
}