#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
const double eps = 1e-8;
const int maxn = 100000 + 10;
int sgn(const double &x) { return (x > eps) - (x < -eps); }
int ans[maxn];
void gao(int a, int b, int c, int d) {
  ans[a] = b;
  ans[b] = d;
  ans[d] = c;
  ans[c] = a;
}
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    if (n == 1)
      printf("1\n");
    else if (n == 2 || n == 3 || n % 4 == 3 || n % 4 == 2)
      printf("-1\n");
    else {
      for (int i = 1, j = n; i < n / 2; i += 2, j -= 2) {
        gao(i, i + 1, j - 1, j);
      }
      if (n % 2 == 1) ans[n / 2 + 1] = n / 2 + 1;
      for (int i = (1); i <= (n - 1); ++i) printf("%d ", ans[i]);
      printf("%d\n", ans[n]);
    }
  }
  return 0;
}
