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