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