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:640000000")
using namespace std;
const double EPS = 1e-9;
const int INF = 0x7f7f7f7f;
const double PI = acos(-1.0);
template <class T>
inline T _abs(T n) {
  return ((n) < 0 ? -(n) : (n));
}
template <class T>
inline T _max(T a, T b) {
  return (!((a) < (b)) ? (a) : (b));
}
template <class T>
inline T _min(T a, T b) {
  return (((a) < (b)) ? (a) : (b));
}
template <class T>
inline T _swap(T& a, T& b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
}
template <class T>
inline T gcd(T a, T b) {
  return (b) == 0 ? (a) : gcd((b), ((a) % (b)));
}
template <class T>
inline T lcm(T a, T b) {
  return ((a) / gcd((a), (b)) * (b));
}
template <typename T>
string NumberToString(T Number) {
  ostringstream second;
  second << Number;
  return second.str();
}
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int a[54][54];
int n;
int call() {
  {
    for (int i = (int)(0); i <= (int)(n - 1); i++) {
      int sum = 0;
      for (int j = (int)(0); j <= (int)(n - 1); j++) {
        sum += a[i][j];
      }
      if (sum % 2 == 0) return 0;
    }
    for (int i = (int)(0); i <= (int)(n - 1); i++) {
      int sum = 0;
      for (int j = (int)(0); j <= (int)(n - 1); j++) {
        sum += a[j][i];
      }
      if (sum % 2 == 0) return 0;
    }
    int sum = 0;
    for (int i = 0; i < n; i++) {
      sum += a[i][i];
    }
    if (sum % 2 == 0) return 0;
    sum = 0;
    for (int i = 0, j = n - 1; i < n; i++, j--) {
      sum += a[i][j];
    }
    if (sum % 2 == 0) return 0;
    return 1;
  }
}
int main() {
  while (~scanf("%d", &n)) {
    int mid = n / 2;
    int in = 1;
    int r = 0, c = mid;
    memset(a, 0, sizeof(a));
    a[r][c] = in++;
    for (int i = (int)(in); i <= (int)(n * n); i++) {
      c++;
      r--;
      if (r < 0 && c >= n) {
        c--;
        r++;
        r++;
        a[r][c] = i;
      } else if (r < 0) {
        r = n - 1;
        a[r][c] = i;
      } else if (c >= n) {
        c = 0;
        a[r][c] = i;
      } else if (a[r][c] != 0) {
        c--;
        r++;
        r++;
        a[r][c] = i;
      } else
        a[r][c] = i;
    }
    for (int i = (int)(0); i <= (int)(n - 1); i++) {
      for (int j = (int)(0); j <= (int)(n - 1); j++) {
        if (j) printf(" ");
        printf("%d", a[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}