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 const Max_N = 150;
int arr[Max_N][Max_N] = {0};
int main() {
  int N;
  scanf("%d", &N);
  int x = (N + 1) / 2;
  int y = (N + 1) / 2;
  for (int i = 1; i < x; i++) {
    for (int j = 1; j < i; j++) {
      arr[i][j] = 1;
    }
    for (int j = i; j < N - i + 2; j++) {
      arr[i][j] = 0;
    }
    for (int j = N - i + 2; j < N + 1; j++) {
      arr[i][j] = 1;
    }
    arr[i][x] = 1;
  }
  for (int i = 1; i < N + 1; i++) arr[x][i] = 1;
  for (int i = x + 1; i < N + 1; i++) {
    for (int j = 1; j < N - i + 1; j++) arr[i][j] = 1;
    for (int j = N - i + 1; j < i + 1; j++) arr[i][j] = 0;
    for (int j = i + 1; j < N + 1; j++) arr[i][j] = 1;
    arr[i][x] = 1;
  }
  int odd = 1;
  int even = 2;
  for (int i = 1; i < N + 1; i++) {
    for (int j = 1; j < N; j++) {
      if (arr[i][j]) {
        printf("%d ", odd);
        odd += 2;
      } else {
        printf("%d ", even);
        even += 2;
      }
    }
    if (arr[i][N]) {
      printf("%d\n", odd);
      odd += 2;
    } else {
      printf("%d\n", even);
      even += 2;
    }
  }
  return 0;
}