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>
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return ((a * b) / gcd(a, b)); }
using namespace std;
int ara[101][101];
int main() {
  int a, b, c, i, j, k, tc, t;
  int n, m = 1, cnt = 0;
  int num = 1;
  scanf("%d", &n);
  if (n == 1)
    printf("1");
  else {
    m = n / 2;
    for (i = 0, a = m, b = 1; i < n / 2; i++, a--, b += 2) {
      for (j = a; j < a + b; j++) ara[i][j] = num, num += 2;
    }
    for (i = 0; i < n; i++) ara[m][i] = num, num += 2;
    b = n - 2;
    for (i = m + 1, a = 1; i < n; i++, a++, b -= 2) {
      for (j = a; j < a + b; j++) {
        ara[i][j] = num, num += 2;
      }
    }
    num = 2;
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        if (ara[i][j] == 0) ara[i][j] = num, num += 2;
      }
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) printf("%d ", ara[i][j]);
      printf("\n");
    }
  }
  return 0;
}