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>
int main() {
  int a[100][100], i, j, n, k, x, y;
  while (scanf("%d", &n) != EOF && (n % 2 == 1)) {
    memset(a, 0, sizeof(a));
    i = 0;
    j = n / 2;
    a[i][j] = 1;
    for (k = 2; k <= n * n; k++) {
      x = i;
      y = j;
      i--;
      j++;
      if (i < 0) i = n - 1;
      if (j > n - 1) j = 0;
      if (a[0][n - 1] != 0) {
        a[1][n - 1] = a[0][n - 1] + 1;
      }
      if (a[i][j] != 0) {
        i = x + 1;
        j = y;
      }
      a[i][j] = k;
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < n - 1; j++) printf("%d ", a[i][j]);
      printf("%d\n", a[i][n - 1]);
    }
  }
  return 0;
}