#include <bits/stdc++.h>
using namespace std;
const int MAXN = 50;
int N;
bool odd[MAXN][MAXN];
int main() {
  scanf("%d", &N);
  if (N == 1) {
    printf("1\n");
    return 0;
  }
  int x = (N * N + 1) / 2;
  for (int i = 0; i < (int)N; i++) odd[i][N / 2] = odd[N / 2][i] = true;
  x -= 2 * N - 1;
  for (int r = 0; r < (int)N && x; r++)
    for (int c = 0; c < (int)N && x; c++) {
      if (!odd[r][c]) {
        odd[r][c] = odd[r][N - 1 - c] = odd[N - 1 - r][c] =
            odd[N - 1 - r][N - 1 - c] = true;
        x -= 4;
      }
    }
  int e = 2, o = 1;
  for (int r = 0; r < (int)N; r++) {
    for (int c = 0; c < (int)N; c++) {
      printf("%d ", odd[r][c] ? o : e);
      odd[r][c] ? o += 2 : e += 2;
    }
    printf("\n");
  }
}
