#include <bits/stdc++.h>
using namespace std;
const int oo = 2000000009;
const int mx = 100005;
int mustbe[mx], p[mx], n;
void solve(int a, int b) {
  if (b - a < 0) return;
  if (b - a == 0) {
    p[a] = a;
    return;
  }
  p[a] = a + 1;
  p[a + 1] = b;
  p[b - 1] = a;
  p[b] = b - 1;
  solve(a + 2, b - 2);
}
int main() {
  scanf("%d", &n);
  if (n % 4 >= 2) {
    printf("-1");
    return 0;
  }
  solve(1, n);
  for (int i = 1; i < (n + 1); ++i) printf("%d ", p[i]);
  fflush(stdout);
  for (int i = 1; i < (n + 1); ++i) assert(p[p[i]] == n - i + 1);
  return 0;
}
