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 T>
inline void rread(T& num) {
  num = 0;
  T f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') num = num * 10 + ch - '0', ch = getchar();
  num *= f;
}
inline int getgcd(int x, int y) { return !x ? y : getgcd(y % x, x); }
inline int power(int x, int k, int p) {
  int res = 1;
  for (; k; k >>= 1, x = 1ll * x * x % p)
    if (k & 1) res = 1ll * res * x % p;
  return res;
}
const double pi = acos(-1);
inline void judge() { freopen("input.txt", "r", stdin); }
const int maxn = 55;
int n, l, r;
int a[maxn][maxn], pnt[2];
int main() {
  rread(n);
  l = r = (n + 1) / 2;
  for (int(i) = (1); (i) <= (n); (i)++) {
    for (int(j) = (l); (j) <= (r); (j)++) a[i][j] = 1;
    if (i < (n + 1) / 2)
      l--, r++;
    else
      l++, r--;
  }
  pnt[0] = 2;
  pnt[1] = 1;
  for (int(i) = (1); (i) <= (n); (i)++) {
    for (int(j) = (1); (j) <= (n); (j)++)
      printf("%d ", pnt[a[i][j]]), pnt[a[i][j]] += 2;
    puts("");
  }
  return 0;
}