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;
using ll = long long;
using pii = pair<int, int>;
using vb = vector<bool>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
using vvvpii = vector<vvpii>;
void Main() {
  int n;
  cin >> n;
  vector<vb> m(n, vb(n, true));
  for (int h = 3; h <= n; h += 2) {
    bool a = (h / 2 % 2 == 1);
    int y = (n - h) / 2;
    int x = y;
    for (int i = int(0); i < int(h - 1); ++i) {
      a = !a;
      m[y][x] = a;
      y++;
    }
    for (int i = int(0); i < int(h - 1); ++i) {
      a = !a;
      m[y][x] = a;
      x++;
    }
    for (int i = int(0); i < int(h - 1); ++i) {
      a = !a;
      m[y][x] = a;
      y--;
    }
    for (int i = int(0); i < int(h - 1); ++i) {
      a = !a;
      m[y][x] = a;
      x--;
    }
  }
  int o = 1;
  int e = 2;
  for (int i = int(0); i < int(n); ++i) {
    for (int j = int(0); j < int(n); ++j) {
      int& x = (m[i][j] ? o : e);
      cout << x << ' ';
      x += 2;
    }
    cout << endl;
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  Main();
  return 0;
}