#include <bits/stdc++.h>
using namespace std;
int A[100002];
int f(int i, int j) {
  if (i == j)
    A[i] = i;
  else if (i < j) {
    A[i] = i + 1;
    A[i + 1] = j;
    A[j] = j - 1;
    A[j - 1] = i;
  }
}
int main(int argc, char **argv) {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  int r = N % 4;
  if (r == 2 || r == 3) return 0 * printf("-1\n");
  for (int i = 1, j = N; i <= j; i += 2, j -= 2) f(i, j);
  for (int i = 1; i <= N; i++) printf("%d ", A[i]);
  printf("\n");
  return 0;
}
