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 = 1e5 + 10;
const int mod = 1e9 + 7;
const long long int INF = 1LL << 62;
long long int power(long long int x, long long int y) {
  long long int t = 1;
  while (y > 0) {
    if (y % 2)
      y -= 1, t = t * x % mod;
    else
      y /= 2, x = x * x % mod;
  }
  return t;
}
long long int inverse(long long int q) {
  long long int t;
  t = power(q, mod - 2);
  return t;
}
long long int gcd(long long int a, long long int b) {
  long long int c;
  if (b == 0)
    return a;
  else
    while (b != 0) {
      c = b;
      b = a % b;
      a = c;
    }
  return a;
}
bool cmp(pair<long long int, long long int> p1,
         pair<long long int, long long int> p2) {
  if (p1.first > p2.first) {
    return true;
  } else if (p1.first == p2.first) {
    if (p1.second <= p2.second) {
      return true;
    } else {
      return false;
    }
  } else {
    return false;
  }
}
long long int prime[1000001] = {0};
int main() {
  long long int n, i, j, k, l, x = 1, y = 2;
  cin >> n;
  long long int a[n][n];
  l = n / 2;
  memset(a, 0, sizeof a);
  for (i = 0; i < n; i++) {
    if (i <= n / 2) {
      for (j = l - i; j <= l + i; j++) {
        a[i][j] = x;
        x += 2;
      }
    } else {
      for (j = i - l; j <= l + n - i - 1; j++) {
        a[i][j] = x;
        x += 2;
      }
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (a[i][j] == 0) {
        cout << y << " ";
        y += 2;
      } else {
        cout << a[i][j] << " ";
      }
    }
    cout << endl;
  }
  return 0;
}