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