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 long long linf = 1e18 + 9;
const int inf = 1e9 + 9;
const long long mod = 1e9 + 7;
const int N = 1e2 + 9;
int n;
int arr[N][N], sum;
int main() {
  scanf("%d", &n);
  int odd = -1;
  int even = 0;
  int odd_n = n * n / 2 + (n * n & 1);
  int odd_u = 1;
  int spa = n / 2;
  int cnt = 1;
  for (int i = 1; i <= n / 2; i++) {
    for (int j = spa + 1; j <= spa + cnt; j++) {
      arr[i][j] = odd += 2;
    }
    cnt += 2;
    spa -= 1;
  }
  for (int i = 1; i <= n; i++) arr[n / 2 + n % 2][i] = odd += 2;
  spa = 1;
  cnt -= 2;
  for (int i = n / 2 + 2; i <= n; i++) {
    for (int j = spa + 1; j <= spa + cnt; j++) {
      arr[i][j] = odd += 2;
    }
    spa++;
    cnt -= 2;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (arr[i][j])
        printf("%d ", arr[i][j]);
      else
        printf("%d ", even += 2);
    }
    puts("");
  }
  return 0;
}