#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100005] = {0}, i, j;
  cin >> n;
  if (n % 4 > 1) {
    cout << -1;
    return 0;
  }
  a[n / 2 + 1] = n / 2 + 1;
  for (j = 1; j <= n / 4; j++) {
    a[n - j * 2 + 1] = j * 2 - 1;
    i = n - j * 2 + 1;
    do {
      a[a[i]] = n - i + 1;
      i = a[i];
    } while (i != n - j * 2 + 1);
  }
  for (i = 1; i <= n; i++) cout << a[i] << " ";
  return 0;
}
