#include <bits/stdc++.h>
using namespace std;
int ar[100001];
int main() {
  int n;
  cin >> n;
  if (n % 4 == 2 || n % 4 == 3) {
    cout << "-1" << endl;
    return 0;
  }
  for (int i = 0; i < n / 4; i++) {
    ar[i * 2 + 1] = i * 2 + 2;
    ar[i * 2 + 2] = n - i * 2;
    ar[n - i * 2] = n - i * 2 - 1;
    ar[n - i * 2 - 1] = i * 2 + 1;
  }
  if (n % 2) ar[(n + 1) / 2] = (n + 1) / 2;
  for (int i = 1; i <= n; i++) cout << ar[i] << ' ';
  cout << endl;
  return 0;
}
