#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      int x = (i + j - 1 + n / 2) % n;
      x *= n;
      x += (i + 2 * j - 2) % n;
      x++;
      printf("%d ", x);
    }
    printf("\n");
  }
  return 0;
}
