#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  if (n % 4 == 2 || n % 4 == 3) {
    cout << -1;
    return 0;
  }
  int arr[n + 1];
  arr[n / 2 + 1] = n / 2 + 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;
  }
  for (int i = int(1); i <= int(n); i++) cout << arr[i] << " ";
}
