#include <bits/stdc++.h>
using namespace std;
int n, record[100010];
void solve() {
  scanf("%d", &n);
  if (n % 4 != 1 && n % 4 != 0) {
    printf("-1");
    return;
  }
  for (int i = 1; i <= n / 2; i += 2) {
    record[i] = i + 1;
    record[i + 1] = n - i + 1;
    record[n - i + 1] = n - i;
    record[n - i] = i;
  }
  if (n & 1) record[n / 2 + 1] = n / 2 + 1;
  for (int i = 1; i <= n; i++) printf("%d ", record[i]);
  printf("\n");
}
int main() {
  solve();
  return 0;
}
