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 double pi = acos(-1.0);
const double EPS = 1e-6;
const int MOD = (int)1e9 + 7;
long long Bigmod(long long b, long long p, long long m) {
  if (p == 0) return 1LL;
  if (p % 2 == 0) {
    long long c = Bigmod(b, p / 2, m);
    return ((c % m) * (c % m)) % m;
  } else
    return ((b % m) * (Bigmod(b, p - 1, m))) % m;
}
long long ModInverse(long long a, long long M) { return Bigmod(a, M - 2, M); }
template <class T>
inline T GCD(T x, T y) {
  if (y == 0) return x;
  return GCD(y, x % y);
}
template <class T>
inline T LCM(T x, T y) {
  return ((x / GCD(x, y)) * y);
}
bool Reverse(long long a, long long b) { return a > b; }
bool Compare(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first) return a.second > b.second;
  return a.first < b.first;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int Grid[n + 1][n + 1], Odd = 1, Even = 2, TotalEven = (n * n) / 2;
  Grid[(n + 1) / 2][(n + 1) / 2] = Odd, Odd += 2;
  for (int i = 1; i <= n; i++) {
    if (i == (n + 1) / 2) continue;
    Grid[i][(n + 1) / 2] = Odd, Odd += 2;
    Grid[(n + 1) / 2][i] = Odd, Odd += 2;
  }
  for (int i = 1; i <= n / 2; i++) {
    for (int j = 1; j <= n / 2; j++) {
      if (TotalEven > 0) {
        Grid[i][j] = Even, Even += 2;
        Grid[i][n + 1 - j] = Even, Even += 2;
        Grid[n + 1 - i][j] = Even, Even += 2;
        Grid[n + 1 - i][n + 1 - j] = Even, Even += 2;
        TotalEven -= 4;
      } else {
        Grid[i][j] = Odd, Odd += 2;
        Grid[i][n + 1 - j] = Odd, Odd += 2;
        Grid[n + 1 - i][j] = Odd, Odd += 2;
        Grid[n + 1 - i][n + 1 - j] = Odd, Odd += 2;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << Grid[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}