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