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;
void addmod(int &a, long long b) {
  a = (a + b);
  if (a >= 1000000007) a -= 1000000007;
}
void mulmod(int &a, long long b) { a = (a * b) % 1000000007; }
int gi() {
  int a;
  scanf("%d", &a);
  return a;
}
long long gll() {
  long long a;
  scanf("%I64d", &a);
  return a;
}
int main() {
  int n = gi();
  vector<vector<int> > ans(n, vector<int>(n, -1));
  vector<bool> v(n * n + 5, 0);
  int ix = 1, b = n / 2, m = n * n;
  for (int j = 0; j < n; j++) {
    if (ans[j][b] == -1) {
      ans[j][b] = ix;
      ix += 2;
    }
    if (ans[b][j] == -1) {
      ans[b][j] = ix;
      ix += 2;
    }
  }
  for (int i = 0; i < b && ix < m; i++)
    for (int j = 0; j < b && ix < m; j++)
      if (ans[i][j] == -1) {
        ans[i][j] = ix;
        ix += 2;
        if (ix <= m) {
          ans[i][n - 1 - j] = ix;
          ix += 2;
        }
        if (ix <= m) {
          ans[n - 1 - i][j] = ix;
          ix += 2;
        }
        if (ix <= m) {
          ans[n - 1 - i][n - 1 - j] = ix;
          ix += 2;
        }
      }
  ix = 2;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (ans[i][j] == -1) {
        ans[i][j] = ix;
        ix += 2;
      }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j) printf(" ");
      printf("%d", ans[i][j]);
    }
    printf("\n");
  }
  return 0;
}