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 N = 50;
int mat[N + 2][N + 2];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int rw = 1;
  for (int i = 1; i <= n; i += 2) {
    for (int j = (n - i) / 2 + 1; j < (n - i) / 2 + 1 + i; j++) {
      mat[rw][j] = 1;
    }
    rw++;
  }
  for (int i = n - 2; i >= 1; i -= 2) {
    for (int j = (n - i) / 2 + 1; j < (n - i) / 2 + 1 + i; j++) {
      mat[rw][j] = 1;
    }
    rw++;
  }
  int od = 1, ev = 2;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (mat[i][j]) {
        cout << od << " ";
        od += 2;
      } else {
        cout << ev << " ";
        ev += 2;
      }
    }
    cout << endl;
  }
  return 0;
}