#include <bits/stdc++.h>
using namespace std;
const int N = 111111;
int rec[N];
int main() {
  int n;
  while (cin >> n) {
    if ((n & 3) >= 2) {
      puts("-1");
      continue;
    }
    int hf = n >> 1;
    for (int i = 1; i <= hf; i++, i++) {
      rec[i] = i + 1;
      rec[n - i] = i;
    }
    for (int i = 2; i <= hf; i++, i++) {
      rec[i] = n - i + 2;
      rec[n - i + 2] = n - i + 1;
    }
    if (n & 1) {
      rec[hf + 1] = hf + 1;
    }
    for (int i = 1; i <= n; i++) cout << rec[i] << ' ';
    cout << endl;
  }
  return 0;
}
