#include <bits/stdc++.h>
using namespace std;
__inline bool nextInt(int &val) {
  char ch;
  int sgn = 1;
  while ((ch = getchar()) != EOF) {
    if (ch == '-') sgn = -1;
    if (ch >= '0' && ch <= '9') break;
  }
  if (ch == EOF) return false;
  val = (int)(ch - '0');
  while (true) {
    ch = getchar();
    if (ch >= '0' && ch <= '9') {
      val = 10 * val + (int)(ch - '0');
    } else
      break;
  }
  val *= sgn;
  return true;
}
__inline bool nextString(string &s) {
  char ch;
  while ((ch = getchar()) != EOF) {
    if (ch >= 33 && ch <= 126) break;
  }
  if (ch == EOF) return false;
  s = string(1, ch);
  while (true) {
    ch = getchar();
    if (ch >= 33 && ch <= 126) {
      s = s + string(1, ch);
    } else
      break;
  }
  return true;
}
int n, p[300888];
int main() {
  ios_base::sync_with_stdio(false);
  scanf("%d", &n);
  memset(p, 0, sizeof(p));
  ;
  if (n % 2 == 1) p[(n + 1) / 2] = (n + 1) / 2;
  for (int i = (1); i < (n + 1); i++)
    if (p[i] == 0) {
      int lastI = i, lastP = i + 1;
      p[lastI] = lastP;
      while (p[lastP] == 0) {
        p[lastP] = n - lastI + 1;
        lastI = lastP;
        lastP = p[lastP];
      }
    }
  bool ok = true;
  for (int i = (1); i < (n + 1); i++)
    if (p[p[i]] != (n - i + 1)) {
      ok = false;
      break;
    }
  if (!ok)
    printf("-1\n");
  else {
    for (int i = (1); i < (n + 1); i++) printf("%d ", p[i]);
    printf("\n");
  }
  return 0;
}
