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 T bigmod(T p, T e, T M) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T bpow(T p, T e) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
  }
  return (T)ret;
}
int toInt(string s) {
  int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int toLlint(string s) {
  long long int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int ts, kk = 1;
int gr[55][55], n;
int main() {
  int t, i, j, k;
  memset(gr, -1, sizeof(gr));
  scanf("%d", &n);
  k = 2;
  t = (n - 2) * 4;
  for (i = 0; k <= n * n && t; i++) {
    if (t <= (n * n - k) / 2 + 1) {
      for (j = i; k <= n * n && j < n - i; j++) {
        if (i != n / 2 && j != n / 2) {
          gr[i][j] = k;
          k += 2;
        }
        if (n - i - 1 != n / 2 && j != n / 2) {
          gr[n - i - 1][j] = k;
          k += 2;
        }
      }
      for (j = i + 1; k <= n * n && j < n - i - 1; j++) {
        if (i != n / 2 && j != n / 2) {
          gr[j][i] = k;
          k += 2;
        }
        if (n - i - 1 != n / 2 && n - j - 1 != n / 2) {
          gr[n - j - 1][n - i - 1] = k;
          k += 2;
        }
      }
    }
    t -= 8;
  }
  k = 1;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (j) printf(" ");
      if (gr[i][j] == -1) {
        printf("%d", k);
        k += 2;
      } else
        printf("%d", gr[i][j]);
    }
    puts("");
  }
  return 0;
}