#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010 * 2;
int p[MAXN];
int main() {
  int N;
  cin >> N;
  if (N % 4 > 1)
    puts("-1");
  else {
    for (int i = 1; i * 2 < N; i += 2) {
      p[i] = i + 1;
      p[i + 1] = N + 1 - i;
      p[N + 1 - i] = N - i;
      p[N - i] = i;
    }
    if (N % 2) p[N / 2 + 1] = N / 2 + 1;
    for (int i = 1; i <= N; ++i) {
      cout << p[i] << " ";
    }
  }
  return 0;
}
