#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 100;
int p[maxn];
int main() {
  int n;
  scanf("%d", &n);
  int i, j;
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  if (n % 2 == 0) {
    if (n % 4) {
      printf("-1\n");
      return 0;
    }
    int l, r;
    l = 0;
    r = n - 1;
    while (l < r) {
      p[l] = l + 1;
      p[l + 1] = r;
      p[r] = r - 1;
      p[r - 1] = l;
      l += 2;
      r -= 2;
    }
  } else {
    if ((n - 1) % 4) {
      printf("-1\n");
      return 0;
    }
    p[n / 2] = n / 2;
    int l = 0;
    int r = n - 1;
    while (l < n / 2 && r > n / 2) {
      p[l] = l + 1;
      p[l + 1] = r;
      p[r] = r - 1;
      p[r - 1] = l;
      l += 2;
      r -= 2;
    }
  }
  for (i = 0; i < n; ++i) printf("%d ", p[i] + 1);
  puts("");
  return 0;
}
