#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  if ((n % 4) != 0 && (n % 4) != 1) {
    cout << (-1) << endl;
    return 0;
  }
  vector<int> p(n + 1, 0);
  if ((n % 4) == 1) p[(n + 1) / 2] = (n + 1) / 2;
  for (int i = 1; i <= n; i++) {
    if (p[i]) continue;
    for (int j = i + 1; j <= n; j++) {
      if (p[j]) continue;
      if (p[n - i + 1] || p[n - j + 1]) continue;
      p[i] = j, p[j] = n - i + 1, p[n - i + 1] = n - j + 1, p[n - j + 1] = i;
      break;
    }
  }
  for (int i = 1; i <= n; i++) cout << p[i] << " ";
  return 0;
}
