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