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