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;
using LL = long long;
using PII = pair<int, int>;
const int N = 50;
int dx, dy;
int a[N][N];
int n;
void deal(int layer) {
  int in = ~layer & 1;
  PII cur = {layer, layer};
  a[cur.first + dx][cur.second + dy] = in;
  in = !in;
  for (int i = 0; i < layer * 2; i++) {
    cur.second--;
    a[cur.first + dx][cur.second + dy] = in;
    in = !in;
  }
  for (int i = 0; i < layer * 2; i++) {
    cur.first--;
    a[cur.first + dx][cur.second + dy] = in;
    in = !in;
  }
  for (int i = 0; i < layer * 2; i++) {
    cur.second++;
    a[cur.first + dx][cur.second + dy] = in;
    in = !in;
  }
  for (int i = 0; i < layer * 2 - 1; i++) {
    cur.first++;
    a[cur.first + dx][cur.second + dy] = in;
    in = !in;
  }
}
int main() {
  cin >> n;
  dx = dy = n / 2;
  for (int layer = 0; layer <= n / 2; layer++) deal(layer);
  int odd = 1;
  int even = 2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j])
        printf("%d", odd), odd += 2;
      else
        printf("%d", even), even += 2;
      if (j + 1 == n)
        cout << endl;
      else
        cout << ' ';
    }
  }
}