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