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