#include <bits/stdc++.h>
using namespace std;
int n, m;
int s[100100];
int main() {
  scanf("%d", &n);
  if (n % 4 == 2 || n % 4 == 3)
    puts("-1");
  else {
    for (int i = 0; i < n / 2; i += 2)
      s[i] = i + 2, s[i + 1] = n - i, s[n - i - 1] = n - i - 1,
      s[n - i - 2] = i + 1;
    if (n % 4 == 1) s[n / 2] = n / 2 + 1;
    for (int i = 0; i < n; i++) printf("%d ", s[i]);
  }
  return 0;
}
