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;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
vector<long long> v;
int n;
int matrix[51][51];
int main() {
  scanf("%d", &n);
  int sqrt = n * n;
  int i = 0;
  int j = n >> 1;
  for (int k = 1; k <= sqrt; ++k) {
    matrix[i][j] = k;
    i--;
    j++;
    if (k % n == 0) {
      i++;
      i++;
      --j;
    } else {
      if (j == n)
        j -= n;
      else {
        if (0 > i) i += n;
      }
    }
  }
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += matrix[i][0];
    for (int j = 0; j < n; j++) {
      printf("%d ", matrix[i][j]);
    }
    printf("\n");
  }
}