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