#include <bits/stdc++.h>
const int N = 100005;
const int inf = 1 << 28;
const double eps = 1e-8;
const int mod = 1e9 + 7;
using namespace std;
int n, a[N];
int main() {
  while (scanf("%d", &n) > 0) {
    if (n == 1)
      puts("1");
    else if (n % 4 == 2 || n % 4 == 3)
      puts("-1");
    else {
      for (int i = 1; i <= n / 2; i += 2) {
        a[i] = i + 1;
        a[a[i]] = n - i + 1;
        a[a[a[i]]] = n - a[i] + 1;
        a[a[a[a[i]]]] = n - a[a[i]] + 1;
      }
      if (n % 4 == 1) a[n / 2 + 1] = n / 2 + 1;
      for (int i = 1; i <= n; i++) printf("%d ", a[i]);
      puts("");
    }
  }
  return 0;
}
