#include <bits/stdc++.h>
using namespace std;
const int OO = (int)2e9;
const double eps = 1e-9;
int arr[100005];
int main() {
  std::ios_base::sync_with_stdio(false);
  int i, n;
  cin >> n;
  if (!((n & 3) && ((n - 1) & 3))) {
    if (n & 1) arr[n / 2 + 1] = n / 2 + 1;
    for (i = 1; i < n / 2; i += 2) {
      arr[i] = i + 1;
      arr[i + 1] = n - i + 1;
      arr[n - i] = i;
      arr[n - i + 1] = n - i;
    }
    for ((i) = (1); (i) < (n + 1); (i)++) cout << arr[i] << " ";
  } else {
    cout << -1 << endl;
    return 0;
  }
  return 0;
}
