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 N = 60 + 10, NM = 1 << 20 + 2, MOD = 1e9 + 7, INF = 1e18 + 10,
                SQ = 500, LOG = 25;
long long n, m, x1, x2, d, z, t, a[N][N], y2, mini, ptr, x, y, ptr1, ptr2, ans,
    k;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  x = (n + 1) / 2;
  y = 1;
  for (int i = 1; i <= n; i++) a[x][i] = y, y += 2;
  ptr1 = 2, ptr2 = n - 1;
  for (int i = 1; i < x; i++) {
    for (int j = ptr1; j <= ptr2; j++) {
      a[i][j] = y;
      y += 2;
    }
    ptr1++, ptr2--;
  }
  ptr1 = 2, ptr2 = n - 1;
  for (int i = n; i > x; i--) {
    for (int j = ptr1; j <= ptr2; j++) {
      a[i][j] = y;
      y += 2;
    }
    ptr1++, ptr2--;
  }
  y = 2;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[i][j])
        cout << a[i][j] << ' ';
      else
        cout << y << ' ', y += 2;
    }
    cout << endl;
  }
}