#include <bits/stdc++.h>
using namespace std;
int a[100005];
int n;
bool solve(int N, int x = 0, int y = n - 1, int st = n) {
  if (N == 0) {
    return true;
  }
  if (N == 1) {
    a[x] = st;
    return true;
  }
  if (N < 4) {
    return false;
  }
  a[x] = x + 2;
  a[x + 1] = st;
  a[y] = st - 1;
  a[y - 1] = x + 1;
  return solve(N - 4, x + 2, y - 2, st - 2);
}
int main(void) {
  scanf("%d", &n);
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  if (n < 4) {
    printf("-1\n");
    return 0;
  }
  if (solve(n)) {
    for (int i = 0; i < n; i++) {
      if (i)
        printf(" %d", a[i]);
      else
        printf("%d", a[i]);
    }
    printf("\n");
  } else {
    printf("-1\n");
  }
  return 0;
}
