#include <bits/stdc++.h>
using namespace std;
const int mx = 1e5 + 10;
int p[mx];
int main() {
  int n;
  cin >> n;
  if (n % 4 > 1) {
    puts("-1");
    return 0;
  }
  int l = 1, r = n;
  while (l < r) {
    p[l] = l + 1;
    p[l + 1] = r;
    p[r] = r - 1;
    p[r - 1] = l;
    l += 2;
    r -= 2;
  }
  if (l == r) p[l] = l;
  for (int i = 1; i <= n; i++) printf("%d ", p[i]);
  puts("");
  return 0;
}
