#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
int t, n, m, i, j, l = 0, k, c = 0, v = 0, x, r = 0, used[1000001] = {0},
                   a[1000001], b[1000001];
char s[1000001], s2[1000001];
int main() {
  scanf("%d", &n);
  if (n % 4 == 2 || n % 4 == 3) {
    printf("-1");
    return 0;
  }
  if (n == 1) {
    printf("1");
    return 0;
  }
  c = 1;
  v = 2;
  l = 2;
  r = n;
  if (n % 4 == 0) {
    for (i = 1, j = n; i <= n / 2, j >= (n / 2) + 1; i += 2, j -= 2) {
      a[i] = l;
      a[i + 1] = r;
      a[j] = r - 1;
      a[j - 1] = l - 1;
      l += 2;
      r -= 2;
    }
    for (i = 1; i <= n; i++) printf("%d ", a[i]);
  } else {
    for (i = 1, j = n; i <= n / 2, j >= (n / 2) + 2; i += 2, j -= 2) {
      a[i] = l;
      a[i + 1] = r;
      a[j] = r - 1;
      a[j - 1] = l - 1;
      l += 2;
      r -= 2;
    }
    a[(n / 2) + 1] = (n / 2) + 1;
    for (i = 1; i <= n; i++) printf("%d ", a[i]);
  }
  return 0;
}
