#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1E-8;
int n;
bool ok[100010];
int p[100010];
int main() {
  scanf("%d", &n);
  if (n % 4 != 0 && n % 4 != 1) {
    puts("-1");
    return 0;
  }
  int st = 1, ed = n;
  int lo = 1, up = n;
  int tot = n;
  while (tot > 1) {
    p[st] = lo + 1;
    p[st + 1] = up;
    p[ed - 1] = lo;
    p[ed] = up - 1;
    st += 2;
    ed -= 2;
    lo += 2;
    up -= 2;
    tot -= 4;
  }
  if (tot == 1) p[(n + 1) / 2] = (n + 1) / 2;
  for (int i = 1; i <= n; i++) printf("%d ", p[i]);
  puts("");
  return 0;
}
