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