#include <bits/stdc++.h>
using namespace std;
int Map[100][100];
int n;
struct Node {
  int y, x;
  int val;
  int step;
};
void cir(int len, int y, int x) {
  int flag = ((len + 1) % 4 == 0 ? -1 : 1);
  for (int i = 0; i < len; i++) {
    Map[y][x + i] = flag * (i % 2 == 0 ? 1 : -1);
    Map[y + i][x] = flag * (i % 2 == 0 ? 1 : -1);
  }
  for (int i = 0; i < len; i++) {
    Map[y + len - 1][x + i] = Map[y][x + i];
    Map[y + i][x + len - 1] = Map[y + i][x];
  }
}
int main() {
  cin.sync_with_stdio(false);
  int odd[10000], fod[10000];
  while (cin >> n) {
    for (int i = 1; i <= n * n; i += 2) odd[i / 2] = i, fod[i / 2] = i + 1;
    int len = 1, c1 = 0, c2 = 0;
    for (int i = n / 2; i >= 0; i--) cir(len, i, i), len += 2;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (j != n - 1)
          cout << (Map[i][j] == 1 ? odd[c1++] : fod[c2++]) << ' ';
        else
          cout << (Map[i][j] == 1 ? odd[c1++] : fod[c2++]) << endl;
      }
    }
  }
  return 0;
}
