#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int ar[n][n];
  for (int k = 0; k < n; k++) {
    for (int l = 0; l < n; l++) {
      ar[k][l] = 0;
    }
  }
  if (n % 2 != 0) {
    int c = n / 2;
    int r = 0;
    for (int i = 1; i <= n * n; i++) {
      if (r < 0) {
        r = n + r;
      }
      if (c > n - 1) {
        c = c - n;
      }
      if (ar[r][c] != 0) {
        c = c - 1;
        r = r + 2;
        if (r > n) {
          r = r - n;
        }
        if (c < 0) {
          c = n + c;
        }
        ar[r][c] = i;
      } else {
        ar[r][c] = i;
      }
      r -= 1;
      c += 1;
    }
  }
  for (int k = 0; k < n; k++) {
    for (int l = 0; l < n; l++) {
      if (n * n < 10)
        printf("%d ", ar[k][l]);
      else if (n * n < 100)
        printf("%2.d ", ar[k][l]);
      else if (n * n < 1000)
        printf("%3.d ", ar[k][l]);
      else if (n * n < 10000)
        printf("%4.d ", ar[k][l]);
    }
    printf("\n");
  }
  return 0;
}
