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;
bool Finish_read;
template <class T>
inline void read(T &x) {
  Finish_read = 0;
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    if (ch == EOF) return;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
  Finish_read = 1;
}
template <class T>
inline void print(T x) {
  if (x / 10 != 0) print(x / 10);
  putchar(x % 10 + '0');
}
template <class T>
inline void writeln(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
  putchar('\n');
}
template <class T>
inline void write(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
}
const int maxn = 55;
int res[maxn][maxn];
int n;
int main() {
  read(n);
  int now = 1;
  int mid = n / 2 + 1;
  for (int i = 1; i <= n / 2 + 1; i++) {
    for (int j = mid - i + 1; j <= mid + i - 1; j++) {
      res[i][j] = now;
      now += 2;
    }
  }
  int len = n / 2;
  for (int i = n / 2 + 2; i <= n; i++) {
    for (int j = mid - len + 1; j <= mid + len - 1; j++) {
      res[i][j] = now;
      now += 2;
    }
    len--;
  }
  now = 2;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (!res[i][j]) {
        res[i][j] = now;
        now += 2;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      printf("%d ", res[i][j]);
    }
    puts("");
  }
  return 0;
}