#include <bits/stdc++.h>
int a[100005];
int main() {
  int n, i;
  while (~scanf("%d", &n)) {
    if (n % 4 == 2 || n % 4 == 3) {
      printf("-1\n");
      continue;
    } else {
      for (i = 1; i <= n / 2; i += 2) {
        a[i] = i + 1;
        a[i + 1] = n - i + 1;
        a[n - i + 1] = n - i;
        a[n - i] = i;
      }
      if (n % 4 == 1) a[n / 2 + 1] = n / 2 + 1;
      for (i = 1; i < n; i++) printf("%d ", a[i]);
      printf("%d\n", a[n]);
    }
  }
  return 0;
}
