#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int a[N];
int main() {
  int n, i;
  scanf("%d", &n);
  if (n % 4 == 2 || n % 4 == 3)
    printf("-1\n");
  else {
    for (i = 1; i <= n / 2; i += 2) {
      a[i] = i + 1;
      a[i + 1] = n - i + 1;
      a[n - i] = i;
      a[n - i + 1] = n - 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;
}
