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