#include <bits/stdc++.h>
using namespace std;
int P[100010];
int main(int argc, const char *argv[]) {
  int n;
  cin >> n;
  if (n % 4 == 2 || n % 4 == 3) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= (n - 1) / 2; i += 2) {
    P[i] = i + 1;
    for (int j = i; P[P[j]] == 0; j = P[j]) {
      P[P[j]] = n - j + 1;
    }
  }
  if (n % 4 == 1) P[(n + 1) / 2] = (n + 1) / 2;
  for (int i = 1; i <= n; i++) cout << P[i] << ' ';
  return 0;
}
