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