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;
int long long n, i, dp[55][55], j, k, h, j2;
bool used[3000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  k = 1;
  j2 = n / 2 + 1;
  for (i = 1; i <= n; i++) dp[j2][i] = k, k += 2;
  for (i = 1; i <= n / 2; i++) {
    for (j = j2 - i + 1; j <= j2 + i - 1; j++) {
      dp[i][j] = k;
      dp[n - i + 1][j] = k + 2;
      k += 4;
    }
  }
  k = 2;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (dp[i][j] == 0) dp[i][j] = k, k += 2;
      cout << dp[i][j] << " ";
    }
    cout << endl;
  }
}