#include <bits/stdc++.h>
using namespace std;
int ara[100005];
int main() {
  int n;
  cin >> n;
  if (n % 4 <= 1) {
    int in = 2;
    for (int i = 1; i <= n / 2; i += 2, in += 2) {
      ara[i] = in;
      ara[n - i + 1] = n - in + 1;
    }
    in = n;
    for (int i = 2; i <= n / 2; i += 2, in -= 2) {
      ara[i] = in;
      ara[n - i + 1] = n + 1 - in;
    }
    if (n % 4 == 1) ara[n / 2 + 1] = n / 2 + 1;
    for (int i = 1; i <= n; i++) cout << ara[i] << " ";
  } else {
    cout << -1;
  }
}
