#include <bits/stdc++.h>
using namespace std;
const double pi =
    3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
int p[100010];
int main() {
  int n;
  scanf("%d", &n);
  if (n % 4 > 1) {
    printf("-1\n");
    return 0;
  }
  int beg = 1, end = n;
  while (beg < end) {
    p[beg] = beg + 1;
    beg++;
    p[end] = end - 1;
    end--;
    p[beg] = end + 1;
    p[end] = beg - 1;
    beg++;
    end--;
  }
  if (n % 4) p[n / 2 + 1] = n / 2 + 1;
  for (int i = (1); i <= (n); ++i) printf("%d ", p[i]);
  printf("\n");
  return 0;
}
