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 = 1e6 + 10;
const long long mod = 1e9 + 7;
void rd(int &x) {
  int f = 1;
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
void pr(int x) { printf("%d\n", x); }
int n, a[55][55];
int go[4][2] = {-1, -1, 1, -1, -1, 1, 1, 1};
pair<int, int> g[4];
int main() {
  int odd = 1, even = 2;
  cin >> n;
  if (n == 1) {
    puts("1");
    return 0;
  }
  if (n == 3) {
    printf("2 1 4\n3 5 7\n6 9 8\n");
    return 0;
  }
  int k = (n + 1) / 2;
  int l = k, r = k;
  for (int i = (1); i <= k; i++) {
    for (int j = (l); j <= r; j++) a[i][j] = odd, odd += 2;
    l--, r++;
  }
  l = k, r = k;
  for (int i = n; i >= k + 1; i--) {
    for (int j = (l); j <= r; j++) a[i][j] = odd, odd += 2;
    l--, r++;
  }
  for (int i = (1); i <= n; i++) {
    for (int j = (1); j <= n; j++) {
      if (a[i][j] == 0) a[i][j] = even, even += 2;
    }
  }
  for (int i = (1); i <= n; i++) {
    for (int j = (1); j <= n; j++) printf("%d ", a[i][j]);
    puts("");
  }
}