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