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;
template <class A, class B>
ostream &operator<<(ostream &out, const pair<A, B> &a) {
  return out << "(" << a.first << "," << a.second << ")";
}
template <class A>
ostream &operator<<(ostream &out, const vector<A> &a) {
  for (const A &it : a) out << it << " ";
  return out;
}
template <class A, class B>
istream &operator>>(istream &in, pair<A, B> &a) {
  return in >> a.first >> a.second;
}
template <class A>
istream &operator>>(istream &in, vector<A> &a) {
  for (A &i : a) in >> i;
  return in;
}
ifstream cinn("in.txt");
ofstream coutt("out.txt");
long long poww(const long long &a, long long b,
               const long long &m = 1000000007) {
  if (b == 0) return 1;
  long long first = poww(a, b / 2, m);
  first = first * first % m;
  if (b & 1) first = first * a % m;
  return first;
}
long long gcd(long long a, long long b) {
  if (a > b) swap(a, b);
  if (a == 0) return b;
  return gcd(b % a, a);
}
bool mod(long double a, long double b) { return a / b - floor(a / b); }
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, j, first, n;
  cin >> n;
  if (n == 1) {
    cout << 1 << '\n';
    return 0;
  }
  long long grid[n][n];
  long long a = 1;
  memset(grid, -1, sizeof(grid));
  for (i = 0; i < n / 2; i++) {
    long long c = n / 2 - i;
    for (j = 0; j < 2 * i + 1; j++) {
      grid[i][c] = a;
      a += 2;
      grid[n - i - 1][c] = a;
      a += 2;
      c++;
    }
  }
  for (i = 0; i < n; i++) {
    grid[n / 2][i] = a;
    a += 2;
  }
  a = 2;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (grid[i][j] == -1) {
        cout << a << " ";
        a += 2;
      } else {
        cout << grid[i][j] << " ";
      }
    }
    cout << '\n';
  }
  return 0;
}