#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, ji, ou, heng, shu, x;
  bool f[55][55];
  int a[55][55];
  memset(f, false, sizeof(f));
  cin >> n;
  f[n / 2 + 1][n / 2 + 1] = true;
  k = n;
  while (k > 1) {
    if (k % 4 == 3)
      heng = shu = (k - 1) / 2;
    else {
      heng = (k - 1) / 2 - 1;
      shu = (k - 1) / 2 + 1;
    }
    x = (n - k) / 2 + 1;
    for (i = n / 2 + 1 - shu / 2; i <= n / 2 + 1 + shu / 2; i++) f[i][x] = true;
    for (j = n / 2 + 1 - heng / 2; j <= n / 2 + 1 + heng / 2; j++)
      f[x][j] = true;
    x = n + 1 - x;
    for (i = n / 2 + 1 - shu / 2; i <= n / 2 + 1 + shu / 2; i++) f[i][x] = true;
    for (j = n / 2 + 1 - heng / 2; j <= n / 2 + 1 + heng / 2; j++)
      f[x][j] = true;
    k -= 2;
  }
  ji = 1;
  ou = 2;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++)
      if (f[i][j]) {
        a[i][j] = ji;
        ji += 2;
      } else {
        a[i][j] = ou;
        ou += 2;
      }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) cout << a[i][j] << " ";
    cout << endl;
  }
  return 0;
}
