#include <bits/stdc++.h>
using namespace std;
int a[100005], n;
bool tui() {
  int nd2 = n / 2, w = 2;
  if (n % 4 == 0) {
    for (int i = 1; i <= nd2; i += 2) {
      a[i] = w, a[i + 1] = n + 2 - w;
      w += 2;
    }
    w = nd2 - 1;
    for (int i = nd2 + 1; i <= n; i += 2) {
      a[i] = w, a[i + 1] = n - w, w -= 2;
    }
  } else if (n % 4 == 1) {
    a[n / 2 + 1] = n / 2 + 1;
    for (int i = 1; i <= nd2; i += 2) {
      a[i] = w, a[i + 1] = n + 2 - w;
      w += 2;
    }
    w = nd2 - 1;
    for (int i = nd2 + 2; i <= n; i += 2) {
      a[i] = w, a[i + 1] = n - w, w -= 2;
    }
  } else
    return false;
  return true;
}
int main() {
  scanf("%d", &n);
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  a[1] = 2;
  if (tui()) {
    for (int i = 1; i < n; ++i) printf("%d ", a[i]);
    printf("%d\n", a[n]);
  } else {
    printf("-1\n");
  }
  return 0;
}
