#include <bits/stdc++.h>
using namespace std;
int ans[200000], was[200000];
int link[200000];
int main() {
  int n;
  scanf("%d", &n);
  if (n % 2 == 1) {
    ans[n / 2 + 1] = n / 2 + 1;
    was[n / 2 + 1] = 1;
  }
  for (int i = 1; i <= n; i++) link[i] = n - i + 1;
  int x = 1;
  for (int i = 1; i <= n; i++) {
    if (ans[i]) continue;
    while (was[x] || x == i) x = x % n + 1;
    int lin = x, pos = i;
    while (ans[pos] == 0) {
      ans[pos] = lin;
      was[lin] = 1;
      lin = pos;
      pos = n - ans[pos] + 1;
    }
  }
  bool f = true;
  for (int i = 1; i <= n; i++) f = f && (link[i] == ans[ans[i]]);
  if (f == false) {
    printf("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
