#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
int n;
int ar[100005];
int main() {
  scanf("%d", &n);
  if (n % 4 == 2 || n % 4 == 3) {
    puts("-1");
    return 0;
  }
  for (int i = 0; i < n / 4; ++i) {
    ar[i * 2] = 2 * i + 2;
    ar[i * 2 + 1] = n - i * 2;
    ar[n - 1 - i * 2] = n - 1 - i * 2;
    ar[n - 2 - i * 2] = i * 2 + 1;
  }
  if (n % 4 == 1) ar[n / 2] = n / 2 + 1;
  for (int i = 0; i < n; ++i) printf("%d\n", ar[i]);
  return 0;
}
