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;
vector<string> split(const string &s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << "\n";
  err(++it, args...);
}
double pi = acos(-1);
const long long N = (1e2) + 10, mod = 1e9 + 7, K = 30;
long long OO = 1e18;
long long n;
int a[N][N];
void f(long long x, long long y, long long l, long long w) {
  for (int i = x; i < x + l; i++) {
    for (int j = y; j < y + w; j++) {
      a[i][j] = 1;
    }
  }
}
void pr() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int l;
    if (i <= n / 2)
      l = 2 * i + 1;
    else
      l = n - 2 * (i - (n / 2));
    int st = (n / 2) - (l / 2);
    f(i, st, 1, l);
  }
  int o = 1, e = 2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << (a[i][j] ? o : e) << " ";
      e += (a[i][j] ? 0 : 2);
      o += (a[i][j] ? 2 : 0);
    }
    cout << endl;
  }
}