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>
bool even[24][24];
void printodd() {
  static int p = 1;
  printf("%d", p);
  p += 2;
}
void printeven() {
  static int p = 2;
  printf("%d", p);
  p += 2;
}
int main() {
  int n;
  scanf("%d", &n);
  int m = n / 2;
  int cnt = m * (m + 1) / 2;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < m; j++)
      if (cnt)
        even[i][j] = 1, cnt--;
      else
        even[i][j] = 0;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < m; j++)
      if (even[i][j])
        printeven(), putchar(' ');
      else
        printodd(), putchar(' ');
    printodd();
    for (int j = m - 1; j >= 0; j--)
      if (even[i][j])
        putchar(' '), printeven();
      else
        putchar(' '), printodd();
    putchar('\n');
  }
  for (int j = 0; j < m; j++) printodd(), putchar(' ');
  printodd();
  for (int j = m - 1; j >= 0; j--) putchar(' '), printodd();
  putchar('\n');
  for (int i = m - 1; i >= 0; i--) {
    for (int j = 0; j < m; j++)
      if (even[i][j])
        printeven(), putchar(' ');
      else
        printodd(), putchar(' ');
    printodd();
    for (int j = m - 1; j >= 0; j--)
      if (even[i][j])
        putchar(' '), printeven();
      else
        putchar(' '), printodd();
    putchar('\n');
  }
}