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>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int lowbit(int x) { return x & -x; }
const double eps = 1e-8;
const int INF = 1e9 + 7;
const long long inf = (1LL << 62);
const int MOD = 1e9 + 7;
const long long mod = (1LL << 32);
const int N = 3e5 + 7;
const int M = 100010;
const int maxn = 2e3 + 7;
template <class T1, class T2>
inline void getmax(T1 &a, T2 b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline void getmin(T1 &a, T2 b) {
  if (b < a) a = b;
}
int read() {
  int v = 0, f = 1;
  char c = getchar();
  while (c < 48 || 57 < c) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (48 <= c && c <= 57) v = v * 10 + c - 48, c = getchar();
  return v * f;
}
int a[N];
int main() {
  int n;
  cin >> n;
  int m = n / 2 + 1;
  int a[n + 1][n + 1];
  int k = 1, l = 2;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (abs(m - i) + abs(m - j) < m) {
        cout << k << ' ';
        k += 2;
      } else {
        cout << l << ' ';
        l += 2;
      }
    }
    cout << endl;
  }
  return 0;
}