#include <bits/stdc++.h>
using namespace std;
vector<int> A;
void Fill(int st, int ed) {
  if (st >= ed) return;
  int a = st, b = st + 1, c = ed - 1, d = ed;
  A[st] = b;
  A[st + 1] = d;
  A[ed - 1] = a;
  A[ed] = c;
  Fill(st + 2, ed - 2);
}
int main(int argc, char **argv) {
  int N;
  cin >> N;
  if (N % 4 != 0 && N % 4 != 1) {
    puts("-1");
    return 0;
  }
  A = vector<int>(N, -1);
  if (N & 1) A[N / 2] = N / 2;
  Fill(0, N - 1);
  for (int i = (0); i < (N); ++i) printf("%d ", A[i] + 1);
  return 0;
}
