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 in(int &x) {
  register int c = getchar();
  x = 0;
  for (; (c < 48 || c > 57); c = getchar())
    ;
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
}
int main() {
  int n, i, j, v[55][55], m, shit = -1;
  in(n);
  memset(v, 0, sizeof v);
  m = n / 2 + 1;
  for (i = 1; i < n + 1; i++)
    for (j = m + 1 - min(i, n + 1 - i); j < m + min(i, n + 1 - i); j++) {
      if (j < 1 || j > n) continue;
      v[i][j] = shit += 2;
    }
  shit = 0;
  for (i = 1; i < n + 1; i++) {
    for (j = 1; j < n + 1; j++) {
      if (!v[i][j]) v[i][j] = shit += 2;
      printf("%d ", v[i][j]);
    }
    printf("\n");
  }
  return 0;
}