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