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 __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
int ara[55][55];
void solve() {
  int n;
  cin >> n;
  vector<pair<int, int> > odds;
  map<pair<int, int>, int> done;
  for (int i = 1; i <= n; i++) {
    odds.push_back({i, n / 2 + 1});
    done[{i, n / 2 + 1}] = 1;
  }
  for (int j = 1; j <= n; j++) {
    if (!done[{n / 2 + 1, j}]) odds.push_back({n / 2 + 1, j});
    done[{n / 2 + 1, j}] = 1;
  }
  for (int k = 1; k <= n / 2; k++) {
    int i = k;
    int j = 1;
    while (i < n && j < n) {
      if (!done[{i, j}]) {
        odds.push_back({i, j});
        done[{i, j}] = 1;
      }
      if (!done[{i, n - j + 1}]) {
        odds.push_back({i, n - j + 1});
        done[{i, n - j + 1}] = 1;
      }
      if (!done[{n - i + 1, j}]) {
        odds.push_back({n - i + 1, j});
        done[{n - i + 1, j}] = 1;
      }
      if (!done[{n - i + 1, n - j + 1}]) {
        odds.push_back({n - i + 1, n - j + 1});
        done[{n - i + 1, n - j + 1}] = 1;
      }
      i++;
      j++;
    }
  }
  for (int i = 0, k = 1; k <= n * n; k += 2, i++) {
    int x = odds[i].first;
    int y = odds[i].second;
    ara[x][y] = k;
  }
  for (int i = 1, k = 2; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (!ara[i][j]) {
        ara[i][j] = k;
        k += 2;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << ara[i][j] << " ";
    cout << "\n";
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}