#include <bits/stdc++.h>
bool even[24][24];
void printodd() {
  static int p = 1;
  printf("%d", p);
  p += 2;
}
void printeven() {
  static int p = 2;
  printf("%d", p);
  p += 2;
}
int main() {
  int n;
  scanf("%d", &n);
  int m = n / 2;
  int cnt = m * (m + 1) / 2;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < m; j++)
      if (cnt)
        even[i][j] = 1, cnt--;
      else
        even[i][j] = 0;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < m; j++)
      if (even[i][j])
        printeven(), putchar(' ');
      else
        printodd(), putchar(' ');
    printodd();
    for (int j = m - 1; j >= 0; j--)
      if (even[i][j])
        putchar(' '), printeven();
      else
        putchar(' '), printodd();
    putchar('\n');
  }
  for (int j = 0; j < m; j++) printodd(), putchar(' ');
  printodd();
  for (int j = m - 1; j >= 0; j--) putchar(' '), printodd();
  putchar('\n');
  for (int i = m - 1; i >= 0; i--) {
    for (int j = 0; j < m; j++)
      if (even[i][j])
        printeven(), putchar(' ');
      else
        printodd(), putchar(' ');
    printodd();
    for (int j = m - 1; j >= 0; j--)
      if (even[i][j])
        putchar(' '), printeven();
      else
        putchar(' '), printodd();
    putchar('\n');
  }
}
