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>
namespace io {
int F() {
  int F = 0, n, ch;
  while (((ch = getchar()) < '0' || ch > '9') && ch != '-')
    ;
  ch == '-' ? F = 1, n = 0 : n = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') n = n * 10 + ch - '0';
  return F ? -n : n;
}
}  // namespace io
int f[70][70] = {0};
int main() {
  int n, x, y;
  n = io::F();
  x = 1, y = n / 2 + 1;
  for (register int i = 1; i <= n * n; ++i) {
    f[x][y] = i;
    if (f[x - 1][y + 1] || (x == 1 && y == n))
      x++;
    else if (x == 1)
      x = n, y++;
    else if (y == n)
      y = 1, x--;
    else
      x--, y++;
  }
  for (register int i = 1; i <= n; i++, puts(""))
    for (register int j = 1; j <= n; j++) printf("%d ", f[i][j]);
  return 0;
}