#include <bits/stdc++.h>
namespace io {
int F() {
  int F = 0, n, ch;
  while (((ch = getchar()) < '0' || ch > '9') && ch != '-')
    ;
  ch == '-' ? F = 1, n = 0 : n = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') n = n * 10 + ch - '0';
  return F ? -n : n;
}
}  // namespace io
int f[70][70] = {0};
int main() {
  int n, x, y;
  n = io::F();
  x = 1, y = n / 2 + 1;
  for (register int i = 1; i <= n * n; ++i) {
    f[x][y] = i;
    if (f[x - 1][y + 1] || (x == 1 && y == n))
      x++;
    else if (x == 1)
      x = n, y++;
    else if (y == n)
      y = 1, x--;
    else
      x--, y++;
  }
  for (register int i = 1; i <= n; i++, puts(""))
    for (register int j = 1; j <= n; j++) printf("%d ", f[i][j]);
  return 0;
}
