#include <bits/stdc++.h>
using namespace std;
int a[60][60];
int odd[3000];
int even[3000];
int op, ep;
int T;
void Init() {
  memset(a, 0, sizeof(a));
  memset(odd, 0, sizeof(odd));
  memset(even, 0, sizeof(even));
  op = 0, ep = 0;
  for (int i = 1; i <= T * T; i++) {
    if (i & 1)
      odd[++op] = i;
    else
      even[++ep] = i;
  }
}
int cd, cp;
void cross() {
  int pp = (T + 1) / 2;
  for (int i = 1; i <= T; i++) a[pp][i] = odd[++cd];
  for (int i = 1; i <= T; i++)
    if (!a[i][pp]) a[i][pp] = odd[++cd];
}
void odd_put() {
  for (int i = 1; i <= T; i++) {
    if (cd > (T * T + 1) / 2) break;
    for (int j = 1; j <= T; j++)
      if (!a[i][j]) {
        a[i][j] = odd[++cd];
        a[i][T - j + 1] = odd[++cd];
        a[T - i + 1][j] = odd[++cd];
        a[T - i + 1][T - j + 1] = odd[++cd];
      }
  }
}
void even_put() {
  for (int i = 1; i <= T; i++)
    for (int j = 1; j <= T; j++)
      if (!a[i][j]) a[i][j] = even[++cp];
}
void out() {
  for (int i = 1; i <= T; i++) {
    for (int j = 1; j <= T; j++) {
      printf("%d ", a[i][j]);
    }
    printf("\n");
  }
  printf("\n");
}
int main() {
  while (cin >> T) {
    cd = 0;
    cp = 0;
    Init();
    cross();
    odd_put();
    even_put();
    out();
  }
  return 0;
}
