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;
const int N = 300201;
inline int scan() {
  char c = getchar();
  int x = 0;
  while (c < '0' || c > '9') {
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return x;
}
long long int add(long long int a, long long int b) {
  return a + b - (a + b >= 1000000007) * 1000000007;
}
long long int sub(long long int a, long long int b) {
  return a - b + (a - b < 0) * 1000000007;
}
long long int mult(long long int a, long long int b) {
  return (1LL * a * b) % 1000000007;
}
inline long long int gcd(long long int a, long long int b) {
  long long int t;
  while (b) {
    a = a % b;
    t = a;
    a = b;
    b = t;
  }
  return a;
}
long long int exponentmod(long long int a, long long int b) {
  long long int res = 1;
  a %= 1000000007;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
int bin_1(long long int x) {
  int r = 0;
  while (x) {
    r++;
    x &= x - 1;
  }
  return r;
}
int mult(int a, int b) {
  long long res = a;
  res *= b;
  if (res >= 1000000007) {
    return res % 1000000007;
  }
  return res;
}
long long int modpow(long long int b, long long int e, long long int m) {
  long long int r = 1;
  b = b % m;
  while (e > 0) {
    if (e % 2 == 1) r = (r * b) % m;
    e /= 2;
    b = (b * b) % m;
  }
  return r;
}
long long int modinverse(long long int a) {
  return modpow(a, 1000000007 - 2, 1000000007);
}
long long int nCrmod(long long int n, long long int r, long long int m) {
  if (r > n) r = n - r;
  long long int res = 1;
  for (long long int i = r; i >= 1; i--) {
    res = (res * (n - i + 1)) % m;
    res = (res * modinverse(i));
  }
  return res;
}
long long int power(long long int b, long long int e) {
  if (e == 0) return 1;
  if (e % 2 == 0) return power(b * b, e / 2);
  return b * power(b * b, e / 2);
}
double powerf(double b, int e) {
  if (e == 0) return 1;
  if (e % 2 == 0)
    return powerf(b * b, e / 2);
  else {
    if (e > 0)
      return b * powerf(b * b, e / 2);
    else
      return powerf(b * b, e / 2) / b;
  }
}
const int sievesize = (long long int)1e6 + 10;
bool prime[sievesize + 1];
void sieve() {
  long long int x, y;
  prime[0] = prime[1] = true;
  for (x = 2; x * x <= sievesize; x++) {
    if (!prime[x])
      for (y = x * x; y <= sievesize; y += x) prime[y] = true;
  }
}
long long int nextPowerOf2(long long int n) {
  n--;
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  n++;
  return n;
}
bool isPerfectSquare(long long int n) {
  if (n < 0) return false;
  long long int tst = (long long int)(sqrt(n) + 0.5);
  return tst * tst == n;
}
bool triangle(long long int a, long long int b, long long int c) {
  return ((a + b) > c && (b + c) > a && (a + c) > b);
}
long long int chartoint(char c) {
  switch (c) {
    case '1':
      return 1;
      break;
    case '2':
      return 2;
      break;
    case '3':
      return 3;
      break;
    case '4':
      return 4;
      break;
    case '5':
      return 5;
      break;
    case '6':
      return 6;
      break;
    case '7':
      return 7;
      break;
    case '8':
      return 8;
      break;
    case '9':
      return 9;
      break;
    default:
      return 0;
      break;
  }
}
long long int isnum(char s) {
  if (s == '1' || s == '2' || s == '3' || s == '4' || s == '5' || s == '6' ||
      s == '7' || s == '8' || s == '9' || s == '0')
    return 1;
  return 0;
}
long long int n;
int main() {
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < n; j++) {
      cout << n * ((i + 1 + j + n / 2) % n) + ((i + 2 * (j + 1) - 1) % n) + 1
           << " ";
    }
    cout << endl;
  }
  return 0;
}