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;
int Map[100][100];
int n;
struct Node {
  int y, x;
  int val;
  int step;
};
void cir(int len, int y, int x) {
  int flag = ((len + 1) % 4 == 0 ? -1 : 1);
  for (int i = 0; i < len; i++) {
    Map[y][x + i] = flag * (i % 2 == 0 ? 1 : -1);
    Map[y + i][x] = flag * (i % 2 == 0 ? 1 : -1);
  }
  for (int i = 0; i < len; i++) {
    Map[y + len - 1][x + i] = Map[y][x + i];
    Map[y + i][x + len - 1] = Map[y + i][x];
  }
}
int main() {
  cin.sync_with_stdio(false);
  int odd[10000], fod[10000];
  while (cin >> n) {
    for (int i = 1; i <= n * n; i += 2) odd[i / 2] = i, fod[i / 2] = i + 1;
    int len = 1, c1 = 0, c2 = 0;
    for (int i = n / 2; i >= 0; i--) cir(len, i, i), len += 2;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (j != n - 1)
          cout << (Map[i][j] == 1 ? odd[c1++] : fod[c2++]) << ' ';
        else
          cout << (Map[i][j] == 1 ? odd[c1++] : fod[c2++]) << endl;
      }
    }
  }
  return 0;
}