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