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 n, a[100][100], k1 = 1, k2 = 2;
int main() {
  iostream::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  int p = (n + 1) / 2;
  int q = 1;
  if (p % 2 == 0) q = 2;
  for (int i = q; i <= n / 2 + 1; i += 2) {
    for (int j = 1; j <= i; j++) {
      if (a[i][j] == 0) {
        a[i][j] = k1;
        k1 += 2;
      }
      if (a[j][i] == 0) {
        a[j][i] = k1;
        k1 += 2;
      }
      if (a[n - i + 1][j] == 0) {
        a[n - i + 1][j] = k1;
        k1 += 2;
      }
      if (a[n - j + 1][i] == 0) {
        a[n - j + 1][i] = k1;
        k1 += 2;
      }
      if (a[n - i + 1][n - j + 1] == 0) {
        a[n - i + 1][n - j + 1] = k1;
        k1 += 2;
      }
      if (a[n - j + 1][n - i + 1] == 0) {
        a[n - j + 1][n - i + 1] = k1;
        k1 += 2;
      }
      if (a[i][n - j + 1] == 0) {
        a[i][n - j + 1] = k1;
        k1 += 2;
      }
      if (a[j][n - i + 1] == 0) {
        a[j][n - i + 1] = k1;
        k1 += 2;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (!a[i][j]) {
        a[i][j] = k2;
        k2 += 2;
      }
      cout << a[i][j] << " ";
    }
    cout << "\n";
  }
  return 0;
}