#include <bits/stdc++.h>
using namespace std;
int n;
int p[100010];
int main() {
  scanf("%d", &n);
  int k = n % 4;
  if (k == 2 || k == 3) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= n / 4; i++) {
    int j = 2 * i - 1;
    p[j] = j + 1;
    p[j + 1] = n + 1 - j;
    p[n + 1 - j] = n - j;
    p[n - j] = j;
  }
  if (k) {
    int t = n / 4 * 2 + 1;
    p[t] = t;
  }
  for (int i = 1; i <= n; i++) printf("%d ", p[i]);
  puts("");
  return 0;
}
