#include <bits/stdc++.h>
using namespace std;
const int N = 101000;
int P[N];
int n;
int main() {
  scanf("%d", &n);
  if ((n % 4) > 1) {
    printf("-1\n");
  } else {
    int dl = (n - (n & 1));
    bool dol = true;
    int naDol = 2, gora = dl;
    for (int i = 0; i < (dl / 2); ++i) {
      if (dol) {
        P[i] = naDol;
        naDol += 2;
      } else {
        P[i] = gora;
        gora -= 2;
      }
      dol = !dol;
    }
    naDol = n / 2 - 1;
    gora = naDol + 2;
    for (int i = 0; i < (dl / 2); ++i) {
      if (dol) {
        P[dl / 2 + i] = naDol;
        naDol -= 2;
      } else {
        P[dl / 2 + i] = gora;
        gora += 2;
      }
      dol = !dol;
    }
    if (n % 2 == 0) {
      for (int i = 0; i < (n); ++i) printf("%d ", P[i]);
    } else {
      int pom = (n + 1) / 2;
      for (int i = 0; i < (dl / 2); ++i) {
        printf("%d ", P[i] + (P[i] >= pom));
      }
      printf("%d ", pom);
      for (int i = 0; i < (dl / 2); ++i) {
        printf("%d ", P[dl / 2 + i] + (P[dl / 2 + i] >= pom));
      }
    }
    printf("\n");
  }
}
