#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
int dx2[] = {1, -1, -1, 1, 0, 0, -1, 1};
int dy2[] = {1, -1, 1, -1, 1, -1, 0, 0};
int kmx[] = {-1, -1, 1, 1, 2, -2, 2, -2};
int kmy[] = {2, -2, 2, -2, -1, -1, 1, 1};
class Timer {
 public:
  clock_t T;
  Timer() { T = clock(); }
  ~Timer() {
    fprintf(stderr, "\n%.3f\n", double(clock() - T) / CLOCKS_PER_SEC);
  }
};
int read() {
  int x;
  scanf("%d", &x);
  return x;
}
long long readL() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const int N = 50;
int a[N][N];
int n;
int main() {
  n = read();
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  int r = 0;
  int i = n / 2;
  int j = 1;
  int o = 1;
  while (1) {
    if (j > n) break;
    int x = j;
    int y = i;
    while (x--) {
      a[r][y++] = o;
      o += 2;
    }
    r++;
    j += 2;
    i--;
  }
  j = n - 2;
  i += 2;
  while (1) {
    if (j < 1) break;
    int x = j;
    int y = i;
    while (x--) {
      a[r][y++] = o;
      o += 2;
    }
    r++;
    j -= 2;
    i++;
  }
  int e = 2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++)
      if (a[i][j] == 0) {
        a[i][j] = e;
        e += 2;
      }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      printf("%d ", a[i][j]);
    }
    printf("\n");
  }
  return 0;
}
