#include <bits/stdc++.h>
using namespace std;
int n, a[200006];
set<int> s;
int main() {
  scanf("%d", &n);
  if (n == 2 || n == 3) {
    printf("-1\n");
    return 0;
  }
  bool f = 1;
  int cur = n;
  int s = n + 1;
  for (int i = n / 2; i >= 1; i--) {
    if (f) {
      a[i] = cur;
      a[n - i + 1] = s - cur;
    } else {
      a[i] = s - cur;
      a[n - i + 1] = cur;
    }
    f = !f;
    cur--;
  }
  if (n % 2) {
    a[n / 2 + 1] = s / 2;
  }
  bool yes = true;
  for (int i = 1; i <= n; i++) {
    if (a[a[i]] != n - i + 1) {
      yes = false;
    }
  }
  if (!yes) {
    printf("-1\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    printf("%d%c", a[i], i == n ? '\n' : ' ');
  }
  return 0;
}
