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 long long INF = 0x7fffffffffffffff;
const int inf = 0x7fffffff;
const double eps = 1e-8;
const int N = 3e5 + 5;
clock_t start, finish;
void time_in() { start = clock(); }
void time_out() {
  finish = clock();
  double tim = (double)(finish - start) / CLOCKS_PER_SEC;
  printf("Running time is %lf\n", tim);
}
inline long long mul(long long a, long long b) {
  long long s = 0;
  while (b) {
    if (b & 1) s = (s + a) % 1000000007;
    a = (a << 1) % 1000000007;
    b >>= 1;
  }
  return s % 1000000007;
}
inline long long pow_mul(long long a, long long b) {
  long long s = 1;
  while (b) {
    if (b & 1) s = mul(s, a);
    a = mul(a, a);
    b >>= 1;
  }
  return s;
}
inline long long poww(long long a, long long b) {
  long long s = 1;
  while (b) {
    if (b & 1) s = (s * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return s % 1000000007;
}
inline int read() {
  char c = getchar();
  int sgn = 1, ret = 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') sgn = -1, c = getchar();
  while (c >= '0' && c <= '9') ret = ret * 10 + c - 48, c = getchar();
  return ret * sgn;
}
void write(int x) {
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
inline long long phi(long long x) {
  long long ans = x;
  for (long long i = 2; i * i <= x; i++)
    if (x % i == 0) {
      ans -= ans / i;
      while (x % i == 0) x /= i;
    }
  if (x > 1) ans -= ans / x;
  return ans;
}
long long inv(long long down) {
  return down == 1
             ? 1
             : ((1000000007 - 1000000007 / down) * inv(1000000007 % down)) %
                   1000000007;
}
long long a[100005], b[100005];
map<int, int> ma;
int main() {
  int n, k;
  scanf("%d", &n);
  int a = 2, b = 1, l = n / 2 + 1;
  int r = l, t = l;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (j <= r && j >= l) {
        printf("%d", b);
        b += 2;
      } else {
        printf("%d", a);
        a += 2;
      }
      if (j != n) printf(" ");
    }
    if (i < t) {
      l--;
      r++;
    } else {
      l++;
      r--;
    }
    printf("\n");
  }
}