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