#include <bits/stdc++.h>
using namespace std;
int n, l, r, i, j, k;
int a[100005];
int main() {
  scanf("%d", &n);
  if ((n % 4 == 0) || ((n - 1) % 4 == 0)) {
    l = 1;
    r = n;
    for (k = 1; k <= n / 4; k++) {
      a[l] = l + 1;
      a[r] = r - 1;
      a[l + 1] = r;
      a[r - 1] = l;
      l += 2;
      r -= 2;
    }
    if ((n - 1) % 4 == 0) a[n / 2 + 1] = n / 2 + 1;
    for (i = 1; i <= n; i++) cout << a[i] << " ";
  } else
    cout << "-1";
  return 0;
}
