#include <bits/stdc++.h>
using namespace std;
inline bool xdy(double x, double y) { return x > y + 1e-9; }
inline bool xddy(double x, double y) { return x > y - 1e-9; }
inline bool xcy(double x, double y) { return x < y - 1e-9; }
inline bool xcdy(double x, double y) { return x < y + 1e-9; }
const long long int mod = 1000000007;
int n;
int ans[100005];
int main() {
  ios_base::sync_with_stdio(0);
  while (~scanf("%d", &n)) {
    if (n % 4 == 2 || n % 4 == 3) {
      printf("-1\n");
      continue;
    }
    for (int i = 1; i <= n / 2; i += 2) {
      ans[i] = i + 1;
      ans[i + 1] = n - i + 1;
      ans[n - i + 1] = n - i;
      ans[n - i] = i;
    }
    if (n & 1) ans[n / 2 + 1] = n / 2 + 1;
    for (int i = 1; i <= n; i++) {
      printf("%d ", ans[i]);
    }
    printf("\n");
  }
}
