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