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;
long long dp[50][50];
int main() {
  long long n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  long long e = 2, o = 1;
  long long t = 0;
  long long mid = n / 2;
  long long cnt = 1;
  memset(dp, 0, sizeof dp);
  for (long long i = 0; i <= n / 2; i++) {
    long long c = cnt;
    for (long long j = mid - t; j < n && c--; j++) {
      dp[i][j] = o;
      o += 2;
    }
    cnt += 2;
    t++;
  }
  t -= 2;
  cnt -= 4;
  for (long long i = n / 2 + 1; i < n; i++) {
    long long c = cnt;
    for (long long j = mid - t; j < n && c--; j++) {
      dp[i][j] = o;
      o += 2;
    }
    cnt -= 2;
    t--;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (dp[i][j])
        cout << dp[i][j] << " ";
      else
        cout << e << " ", e += 2;
    }
    cout << endl;
  }
  return 0;
}