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 = int_fast64_t;
constexpr int mod = 1e9 + 7;
constexpr int inf = (1 << 30) - 1;
constexpr ll infll = (1LL << 61) - 1;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int main() {
  int N;
  cin >> N;
  vector<vector<int>> a(N, vector<int>(N, 1));
  for (int i = 0; i < N / 2; i++) {
    int mx = N / 2 - i;
    for (int j = 0; j < mx; j++) {
      a[i][j] = 0;
      a[i][N - j - 1] = 0;
    }
  }
  for (int i = 0; i < N / 2; i++) {
    int mx = N / 2 - i;
    for (int j = 0; j < mx; j++) {
      a[N - i - 1][j] = 0;
      a[N - i - 1][N - j - 1] = 0;
    }
  }
  int even = 2, odd = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      a[i][j] = (a[i][j] % 2 == 0 ? even : odd);
      cout << a[i][j] << " ";
      (a[i][j] % 2 == 0 ? even : odd) += 2;
    }
    cout << "\n";
  }
}