#include <bits/stdc++.h>
using namespace std;
long long int res[100005];
int main() {
  long long int n;
  scanf("%lld", &n);
  if (n % 4 == 2 || n % 4 == 3) {
    printf("-1");
    exit(0);
  }
  long long int c = 2;
  for (long long int i = 0; i < n / 2; i += 2) {
    res[i] = c;
    res[i + 1] = n - i;
    c += 2;
  }
  c = 1;
  for (long long int i = n - 2; i >= n / 2; i -= 2) {
    res[i] = c;
    res[i + 1] = n - c;
    c += 2;
  }
  if (n % 2) res[n / 2] = n / 2 + 1;
  for (long long int i = 0; i < n; i++) printf("%lld ", res[i]);
}
