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 GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
long long max(long long a, long long b) {
  if (a < b) return b;
  return a;
}
long long min(long long a, long long b) {
  if (a < b) return a;
  return b;
}
long long X[] = {-1, 1, 0, 0};
long long Y[] = {0, 0, -1, 1};
long long XX[] = {-1, 1, 0, 0, -1, 1, -1, 1};
long long YY[] = {0, 0, -1, 1, -1, 1, 1, -1};
long long HX[] = {1, -1, 2, -2, 1, -1, -2, 2};
long long HY[] = {2, -2, 1, -1, -2, 2, 1, -1};
long long fpow(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) {
      res = res * x % 1000000007;
    }
    x = x * x % 1000000007;
    n >>= 1;
  }
  return (res % 1000000007);
}
long long binomialCoeff(long long n, long long k) {
  long long C[n + 1][k + 1];
  long long i, j;
  for (i = 0; i <= n; i++) {
    for (j = 0; j <= min(i, k); j++) {
      if (j == 0 || j == i)
        C[i][j] = 1;
      else
        C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % 1000000007;
    }
  }
  return C[n][k];
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int n;
bool read() { return !!(cin >> n); }
const int N = 101;
int a[N][N];
void solve() {
  long long n;
  cin >> n;
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n / 2; i++) {
    int len = n / 2 - i;
    for (int j = 0; j < len; j++) {
      int x1 = i, x2 = n - 1 - i;
      int y1 = j, y2 = n - 1 - j;
      a[x1][y1] = 1;
      a[x1][y2] = 1;
      a[x2][y1] = 1;
      a[x2][y2] = 1;
    }
  }
  int odd = 1, even = 2;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (a[i][j])
        a[i][j] = even, even += 2;
      else
        a[i][j] = odd, odd += 2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j) putchar(' ');
      printf("%d", a[i][j]);
    }
    puts("");
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}