#include <bits/stdc++.h>
using namespace std;
int a[100002];
int main() {
  int n;
  cin >> n;
  if (n % 4 > 1) return cout << -1, 0;
  if (n % 4 == 1) a[(n - 1) / 2 + 1] = (n - 1) / 2 + 1;
  int e = n / 2;
  for (int i = 1; i < e; 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] << ' ';
}
