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 i, j, k, ecnt, ocnt, n;
  static int e[2048], o[2048];
  scanf("%d", &n);
  for (i = 2; i <= n * n; i += 2) e[i / 2 - 1] = i;
  for (i = 1; i <= n * n; i += 2) o[i / 2] = i;
  ecnt = ocnt = 0;
  for (i = 1; i <= n; i++) {
    k = (n - 2 * i + 1) / 2;
    if (k < 0) k = -k;
    for (j = 0; j < k; j++) printf("%d ", e[ecnt++]);
    for (j = 0; j < n - 2 * k; j++) printf("%d ", o[ocnt++]);
    for (j = 0; j < k; j++) printf("%d ", e[ecnt++]);
    printf("\n");
  }
  return 0;
}