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;
const int MAXN = 50;
int N;
bool odd[MAXN][MAXN];
int main() {
  scanf("%d", &N);
  if (N == 1) {
    printf("1\n");
    return 0;
  }
  int x = (N * N + 1) / 2;
  for (int i = 0; i < (int)N; i++) odd[i][N / 2] = odd[N / 2][i] = true;
  x -= 2 * N - 1;
  for (int r = 0; r < (int)N && x; r++)
    for (int c = 0; c < (int)N && x; c++) {
      if (!odd[r][c]) {
        odd[r][c] = odd[r][N - 1 - c] = odd[N - 1 - r][c] =
            odd[N - 1 - r][N - 1 - c] = true;
        x -= 4;
      }
    }
  int e = 2, o = 1;
  for (int r = 0; r < (int)N; r++) {
    for (int c = 0; c < (int)N; c++) {
      printf("%d ", odd[r][c] ? o : e);
      odd[r][c] ? o += 2 : e += 2;
    }
    printf("\n");
  }
}