#include <bits/stdc++.h>
using namespace std;
int n;
int p[100010];
bool used[100010];
int main() {
  scanf("%d", &n);
  memset(p, 0, sizeof(p));
  memset(used, false, sizeof(used));
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  if (n % 2 == 0) {
    if (n % 4 != 0) {
      printf("-1\n");
      return 0;
    }
  } else {
    if ((n - 1) % 4 != 0) {
      printf("-1\n");
      return 0;
    }
  }
  if (n % 2 != 0) {
    p[n / 2 + 1] = n / 2 + 1;
    used[n / 2 + 1] = true;
  }
  for (int i = 1; i <= n / 2; i++) {
    if (!p[i]) {
      int num = 1;
      while (used[num] || num == i) num++;
      p[i] = num;
      used[num] = true;
      p[num] = n + 1 - i;
      used[n + 1 - i] = true;
      p[n + 1 - i] = n + 1 - num;
      used[n + 1 - num] = true;
      p[n + 1 - num] = i;
      used[i] = true;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d ", p[i]);
  return 0;
}
