#include <bits/stdc++.h>
const double eps = 1e-6;
const double PI = acos(-1.0);
const int inf = ~0u >> 2;
using namespace std;
const int N = 100010;
int p[N];
int main() {
  int n, i;
  while (~scanf("%d", &n)) {
    if (n == 1) {
      puts("1");
      continue;
    }
    if (n < 4) {
      puts("-1");
      continue;
    }
    if (n % 4 != 0 && (n - 1) % 4 != 0) {
      puts("-1");
      continue;
    }
    for (i = 1; i <= n / 4; ++i) {
      p[i] = i + n / 4;
      p[p[i]] = n - i + 1;
      p[p[p[i]]] = n - p[i] + 1;
      p[p[p[p[i]]]] = n - p[p[i]] + 1;
    }
    if ((n - 1) % 4 == 0) {
      p[n / 2 + 1] = n / 2 + 1;
    }
    for (i = 1; i < n; ++i) {
      printf("%d ", p[i]);
    }
    printf("%d\n", p[n]);
  }
  return 0;
}
