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 int MAX = (const int)(1e5 + 11);
static void solve(std::int32_t test) {
  int N;
  cin >> N;
  int c1 = 1, c2 = 2, cur = 1;
  for (int i = 0; i < N; ++i) {
    int a = (N - cur) / 2, b = (N - cur) / 2 + cur, c = N;
    for (int j = 0; j < a; ++j, c2 += 2) cout << c2 << " ";
    for (int j = a; j < b; ++j, c1 += 2) cout << c1 << " ";
    for (int j = b; j < c; ++j, c2 += 2) cout << c2 << " ";
    cout << "\n";
    if (i < N / 2)
      cur += 2;
    else
      cur -= 2;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cout << setprecision(12) << fixed;
  solve(0);
  return 0;
}