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 main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> even, odd;
  for (auto i = 1; i <= (long long)(n * n); i++)
    if (i & 1)
      odd.push_back(i);
    else
      even.push_back(i);
  int half = (n + 1) / 2, val = 1, o = n - 1;
  vector<int> x;
  for (auto i = 1; i <= (long long)(half); i++) {
    for (auto j = 0; j < (long long)(o / 2); j++)
      x.push_back(even.back()), even.pop_back();
    for (auto j = 0; j < (long long)(val); j++)
      x.push_back(odd.back()), odd.pop_back();
    for (auto j = 0; j < (long long)(o / 2); j++)
      x.push_back(even.back()), even.pop_back();
    val += 2, o -= 2;
  }
  val -= 2;
  o += 2;
  for (int i = half - 1; i >= 1; i--) {
    val -= 2, o += 2;
    for (auto j = 0; j < (long long)(o / 2); j++)
      x.push_back(even.back()), even.pop_back();
    for (auto j = 0; j < (long long)(val); j++)
      x.push_back(odd.back()), odd.pop_back();
    for (auto j = 0; j < (long long)(o / 2); j++)
      x.push_back(even.back()), even.pop_back();
  }
  for (auto i = 0; i < (long long)(((int)((x).size()))); i++) {
    cout << x[i] << " ";
    if ((i + 1) % n == 0) cout << '\n';
  }
  return 0;
}