#include <bits/stdc++.h>
int n;
int f[100002];
void DP() {
  int i, x, y;
  for (i = 1; 2 * i <= n; i += 2) {
    x = i;
    y = i + 1;
    f[x] = y;
    f[y] = n - x + 1;
    f[n - x + 1] = n - y + 1;
    f[n - y + 1] = x;
  }
  if (n % 4) f[(n + 1) / 2] = (n + 1) / 2;
  for (i = 1; i < n; i++) printf("%d ", f[i]);
  printf("%d\n", f[n]);
}
int main() {
  while (~scanf("%d", &n)) {
    if (n == 1 || (n % 4) <= 1)
      DP();
    else
      puts("-1");
  }
  return 0;
}
