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