#include <bits/stdc++.h>
int m, n;
int a[100050];
int main() {
  int i, j, k, x, y, z;
  scanf("%d", &n);
  if (n % 4 == 2 || n % 4 == 3)
    puts("-1");
  else {
    j = n;
    i = 1;
    while (j >= i) {
      if (j == i)
        a[i] = i;
      else {
        a[i] = i + 1;
        a[i + 1] = j;
        a[j] = n - i;
        a[j - 1] = n + 1 - j;
      }
      i += 2;
      j -= 2;
    }
    for (i = 1; i <= n; i++) {
      printf("%d ", a[i]);
    }
  }
  getchar();
  getchar();
}
