#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, t, j, tmp, n, m, k, cnt, fl, ind;
  cin >> n;
  if (n % 4 != 0 and n % 4 != 1) {
    printf("-1\n");
    return 0;
  }
  vector<int> ar(n);
  ar[n / 2] = n / 2 + 1;
  i = 0;
  j = n - 1;
  while (i < j) {
    ar[i] = i + 2;
    ar[i + 1] = j + 1;
    ar[j] = j;
    ;
    ar[j - 1] = i + 1;
    i += 2;
    j -= 2;
  }
  for (typeof(ar.begin()) it = ar.begin(); it != ar.end(); it++) {
    cout << *it << " ";
  }
  printf("\n");
  ;
}
