#include <bits/stdc++.h>
using namespace std;
int p[100005];
bool m[100005];
int cnt;
int n;
void rec(int k) {
  if (m[k]) return;
  m[k] = true;
  p[p[k]] = (n - (k) + 1);
  cnt++;
  rec(p[k]);
}
int main() {
  scanf(" %d", &n);
  for (int i = 1; i <= n; i++)
    if ((n - (i) + 1) == i) p[i] = i, m[i] = true, cnt++;
  int start = 0;
  for (int i = 1; i <= n; i++)
    if (!m[i]) {
      int start = 0;
      for (int k = i + 1; k <= n; k++)
        if (!m[k] && (n - (i) + 1) != k) {
          cnt++;
          m[i] = true;
          p[i] = start = k;
          p[p[i]] = (n - (i) + 1);
          break;
        }
      if (!start && cnt < n) {
        printf("-1\n");
        return 0;
      }
      rec(start);
    }
  if (cnt < n) {
    printf("-1\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) printf("%d ", p[i]);
  printf("\n");
  return 0;
}
