#include <bits/stdc++.h>
using namespace std;
int p[100010];
int main(void) {
  int N, i;
  cin >> N;
  if (N % 4 >= 2) {
    cout << -1 << endl;
    return 0;
  }
  p[N / 2] = N / 2;
  int A = 0, B = 1, C = N - 2, D = N - 1;
  while (1) {
    if (B >= C) break;
    p[A] = B;
    p[B] = D;
    p[D] = C;
    p[C] = A;
    A += 2;
    B += 2;
    C -= 2;
    D -= 2;
  }
  for ((i) = 0; (i) < (int)(N); (i)++) {
    printf("%d", p[i] + 1);
    if (i == N - 1)
      printf("\n");
    else
      printf(" ");
  }
  return 0;
}
