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 ar[1000][1000];
void print(int n) {
  int i, j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cout << ar[i][j] << " ";
    }
    cout << "\n";
  }
  cout << "--------------\n";
}
int main() {
  int n;
  cin >> n;
  int centre = n / 2;
  ar[centre][centre] = 1;
  int i, j;
  int val = 0;
  int d = 1;
  for (i = 1; i < n; i += 2) {
    int z = (2 * i + 2);
    int val = d;
    for (j = centre; j < centre + val; j++) {
      ar[centre + d][j] = 1;
      ar[centre - d][j] = 1;
    }
    for (j = centre; j > centre - val; j--) {
      ar[centre + d][j] = 1;
      ar[centre - d][j] = 1;
    }
    ar[centre][centre + d] = 1;
    ar[centre][centre - d] = 1;
    d++;
  }
  int count1 = 1;
  int count2 = 2;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (ar[i][j] == 1) {
        ar[i][j] = count1;
        count1 += 2;
      } else {
        ar[i][j] = count2;
        count2 += 2;
      }
      cout << ar[i][j] << " ";
    }
    cout << "\n";
  }
  return 0;
}