#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int arr[maxn];
int main() {
  int n;
  cin >> n;
  if (n % 4 == 0 || n % 4 == 1) {
    for (int i = 1; i <= n / 2; i += 2) {
      arr[i] = i + 1;
      arr[i + 1] = n - i + 1;
      arr[n - i + 1] = n - i;
      arr[n - i] = i;
    }
    if (n % 4 == 1) arr[n / 2 + 1] = n / 2 + 1;
  } else {
    cout << "-1" << endl;
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    printf("%d%c", arr[i], " \n"[i == n]);
  }
  return 0;
}
