#include <bits/stdc++.h>
using namespace std;
int S[100003];
int main() {
  int n, d;
  cin >> n;
  d = n / 4;
  if (n % 4 == 2 || n % 4 == 3) {
    cout << -1;
    return 0;
  }
  if (n & 1) {
    S[(n + 1) / 2] = (n + 1) / 2;
  }
  for (int i = 0; i != d; i++) {
    S[2 * i + 1] = 2 * i + 2;
    S[2 * i + 2] = n - 2 * i;
    S[n - 2 * i] = n - 2 * i - 1;
    S[n - 2 * i - 1] = 2 * i + 1;
  }
  for (int i = 1; i <= n; i++) {
    cout << S[i] << ' ';
  }
}
