#include <bits/stdc++.h>
using namespace std;
int v[100010];
int main() {
  int n;
  while (cin >> n) {
    memset(v, 0, sizeof(v));
    if (n % 4 == 2 || n % 4 == 3) {
      cout << -1 << endl;
      continue;
    }
    if (n == 1) {
      cout << 1 << endl;
      continue;
    }
    int m = n / 4;
    m <<= 1;
    int i;
    for (i = 1; i <= m; i += 2) {
      v[i] = i + 1;
      v[i + 1] = n - i + 1;
      v[n - i + 1] = n - i;
      v[n - i] = i;
    }
    if (n % 4 == 1) {
      v[i] = i;
    }
    for (int i = 1; i <= n; i++) {
      printf("%d ", v[i]);
    }
    cout << endl;
  }
  return 0;
}
