#include <bits/stdc++.h>
const int N = 100010;
int p[N];
int L[N];
int cnt[N];
int partner[N];
int list[N];
void combine(int i, int j) {
  assert(L[i] == L[j]);
  assert(L[i] > 0 && !(L[i] & 1));
  int flag = 0;
  list[0] = i;
  list[1] = j;
  int n = 2;
  int ci = p[i], cj = p[j];
  while (ci != i && cj != j) {
    list[n++] = ci;
    list[n++] = cj;
    ci = p[ci];
    cj = p[cj];
  }
  assert(ci == i && cj == j);
  assert(n == 2 * L[i]);
  list[n] = list[0];
  for (int r = 0; r < n; r++) p[list[r]] = list[r + 1];
}
int main() {
  int n;
  scanf("%d", &n);
  memset(cnt, 0, (n + 2) * sizeof(int));
  memset(L, 0, (n + 2) * sizeof(int));
  int i, j;
  for (i = 1; i <= n; i++) {
    p[i] = n - i + 1;
  }
  for (i = 1; i <= n; i++) {
    if (!L[i]) {
      L[i] = 1;
      int j = p[i];
      while (!L[j]) {
        L[j] = -i;
        L[i]++;
        j = p[i];
      }
      cnt[L[i]]++;
    }
  }
  bool flag = true;
  for (i = 2; i <= n; i += 2) {
    if (cnt[i] & 1) {
      flag = false;
      break;
    }
  }
  if (!flag) {
    printf("-1\n");
    return 0;
  }
  memset(partner, 0, (n + 2) * sizeof(int));
  for (i = 1; i <= n; i++) {
    if (L[i] > 0 && !(L[i] & 1)) {
      int my_partner = partner[L[i]];
      if (my_partner == 0) {
        partner[L[i]] = i;
      } else {
        partner[L[i]] = 0;
        combine(i, my_partner);
      }
    }
  }
  for (i = 1; i < n; i++) printf("%d ", p[i]);
  printf("%d\n", p[n]);
  return 0;
}
