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>
const int INF = 0x7F7F7F7F;
const double EPS = 1e-10;
const long long mod7 = 1e9 + 7;
const long long mod9 = 1e9 + 9;
using namespace std;
inline long long rit() {
  long long f = 0, key = 1;
  char c;
  do {
    c = getchar();
    if (c == '-') key = -1;
  } while (c < '0' || c > '9');
  do {
    f = f * 10 + c - '0';
    c = getchar();
  } while (c >= '0' && c <= '9');
  return f * key;
}
inline void fprt(double f) { printf("%.08lf", f); }
void init() {}
const int Z = 55;
int n;
int mk[Z][Z];
void read() {
  n = rit();
  ;
}
void solve() {
  int cnt = 0, oc = 1, ec = 2;
  for (int i = 0; i < n / 2 + 1; i++) {
    for (int j = 0; j < cnt; j++) {
      mk[i][j] = mk[i][n - 1 - j] = mk[n - 1 - i][j] =
          mk[n - 1 - i][n - 1 - j] = 1;
    }
    cnt++;
  }
  for (int i = 0; i < n; i++) mk[i][n / 2] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (mk[i][j]) {
        cout << oc << ' ';
        oc += 2;
      } else {
        cout << ec << ' ';
        ec += 2;
      }
    }
    cout << endl;
  }
}
int main() {
  int nn = 1;
  init();
  while (nn--) {
    read();
    solve();
  }
  return 0;
}