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;
long long int gcd(long long int n1, long long int n2) {
  if (n2 == 0) return n1;
  return gcd(n2, n1 % n2);
}
long long int powmod(long long int base, long long int exponent) {
  long long int ans = 1;
  while (exponent) {
    if (exponent & 1) ans = (ans * base);
    base = (base * base);
    exponent /= 2;
  }
  return ans;
}
long long int modexp(long long int a, long long int b, long long int m) {
  if (b == 0) return 1;
  long long int temp = modexp(a, b / 2, m);
  if (b % 2 == 1) return (((temp % m) * (temp % m)) % m * (a % m)) % m;
  return ((temp % m) * (temp % m)) % m;
}
int factor(int n) {
  int i, c = 0;
  for (i = 1; i * i <= n; i++) {
    if (i * i == n)
      c += 1;
    else if (n % i == 0)
      c += 2;
  }
  return c;
}
int A[49][49];
int main() {
  for (int i = 0; i < 49; i++) {
    for (int j = 0; j < 49; j++) {
      A[i][j] = 0;
    }
  }
  int m = 2;
  int x = 23, y;
  int p = 23, q = 23;
  A[24][24] = 1;
  while (x >= 0) {
    y = 48 - x;
    int a = p, b = q;
    for (; a >= x; a--) {
      A[a][b] = m++;
    }
    a = x;
    b = x + 1;
    for (; b <= y; b++) {
      A[a][b] = m++;
    }
    b = y;
    a = x + 1;
    for (; a <= y; a++) {
      A[a][b] = m++;
    }
    a = y;
    b = y - 1;
    for (; b >= x; b--) {
      A[a][b] = m++;
    }
    b = x;
    a = y - 1;
    for (; a > p; a--) {
      A[a][b] = m++;
    }
    a++;
    p = a;
    q = b;
    x--;
    p--;
    q--;
  }
  int n;
  cin >> n;
  int fox = 24 - (n / 2);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << A[fox + i][fox + j] << " ";
    }
    cout << '\n';
  }
  return 0;
}