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 int MAXN = 1e5 + 10;
const int INF = 1e9 + 9;
const int MOD = 1e9 + 7;
int n, a[60][60];
queue<int> qo, qe;
int main() {
  cin >> n;
  for (int i = 1, _b = (n * n); i <= _b; i++)
    if (i % 2)
      qo.push(i);
    else
      qe.push(i);
  int mid = (n / 2) + 1;
  for (int i = 1, _b = (n); i <= _b; i++) {
    int no = (mid - abs(mid - i)) * 2 - 1;
    int z = no;
    for (int j = 1, _b = (n); j <= _b; j++)
      if (j >= mid - (no / 2) && z > 0) {
        a[i][j] = qo.front();
        qo.pop();
        z--;
      } else {
        a[i][j] = qe.front();
        qe.pop();
      }
  }
  for (int i = 1, _b = (n); i <= _b; i++) {
    for (int j = 1, _b = (n); j <= _b; j++) cout << a[i][j] << " ";
    cout << endl;
  }
}