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