#include <bits/stdc++.h>
using namespace std;
int p[100100];
int main() {
  int n, i;
  scanf("%d", &n);
  if (n % 4 != 0 && n % 4 != 1) {
    printf("-1\n");
    return 0;
  }
  for (i = 1; i <= n / 2; i += 2) {
    p[i] = i + 1;
    p[i + 1] = n + 1 - i;
    p[n - i + 1] = n - i;
    p[n - i] = i;
  }
  if (n % 4 == 1) p[n / 2 + 1] = n / 2 + 1;
  for (i = 1; i <= n; i++) printf("%d ", p[i]);
  printf("\n");
  return 0;
}
