#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, n, m, i, j, ans, l, r, lcnt = 1, rcnt;
int ar[100005];
int main() {
  scanf("%d\n", &n);
  if (n % 4 > 1) {
    printf("-1\n");
    return 0;
  }
  lcnt = 1, rcnt = n;
  l = 1, r = n;
  for (i = 0; i <= n - 4; i += 4) {
    ar[l++] = lcnt + 1;
    ar[l++] = rcnt;
    ar[r--] = rcnt - 1;
    ar[r--] = lcnt;
    lcnt += 2;
    rcnt -= 2;
  }
  if (n % 4 == 1) {
    ar[n / 2 + 1] = n / 2 + 1;
  }
  for (i = 1; i <= n; i++) {
    printf("%d ", ar[i]);
  }
  return 0;
}
