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