#include <bits/stdc++.h>
const bool debug = false;
using namespace std;
long long powmod(long long a, long long b, long long MOD) {
  long long res = 1;
  a %= MOD;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
  }
  return res;
}
void buginfo(const char* f, ...) {
  if (!debug) return;
  va_list al;
  va_start(al, f);
  vprintf(f, al);
  va_end(al);
}
const int maxn = 1e5 + 10;
int n, a[maxn];
int main() {
  scanf("%d", &n);
  if (n % 4 == 2 || n % 4 == 3) {
    printf("-1\n");
    return 0;
  }
  int p = 1, q = n;
  while (p < q) {
    a[p] = p + 1;
    a[p + 1] = q;
    a[q] = q - 1;
    a[q - 1] = p;
    p += 2, q -= 2;
  }
  if (p == q) a[p] = p;
  for (int i = 1; i < n + 1; ++i) printf("%d ", a[i]);
  printf("\n");
  return 0;
}
