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 long long mod = 1e9 + 7;
const long long inf = 1e17;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
long long ceil_div(long long a, long long b) { return (a + b - 1) / b; }
long long power(long long a, long long b) {
  if (b == 0) return 1;
  if (a == 1) return 1;
  long long x = power(a, b / 2);
  if (b % 2 == 0)
    return (x * x);
  else
    return (a * ((x * x)));
}
long long divide(long long a, long long b) {
  return a * power(b, mod - 2) % mod;
}
void solve() {
  long long n;
  cin >> n;
  if (n == 1) {
    cout << 1 << '\n';
    return;
  }
  long long ans[n][n];
  memset(ans, 0, sizeof(ans));
  for (long long i = 0; i < n / 2; i++) {
    for (long long j = 0; j <= i; j++) ans[j][i] = 2;
    for (long long j = n - 1; j >= n - 1 - i; j--) ans[j][i] = 2;
  }
  for (long long i = n - 1; i > n / 2; i--) {
    for (long long j = 0; j <= n - i - 1; j++) ans[j][i] = 2;
    for (long long j = n - 1; j >= i; j--) ans[j][i] = 2;
  }
  long long odd = 1, even = 2;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (ans[i][j] == 0) {
        ans[i][j] = odd;
        odd += 2;
      } else {
        ans[i][j] = even;
        even += 2;
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) cout << ans[i][j] << ' ';
    cout << '\n';
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(15) << fixed;
  long long tc;
  tc = 1;
  while (tc--) {
    solve();
  }
}