#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int MAXN = 100000 + 9;
template <class T>
inline T f_min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline T f_max(T a, T b) {
  return a > b ? a : b;
}
template <class T>
inline T f_abs(T a) {
  return a > 0 ? a : -a;
}
template <class T>
inline T f_gcd(T a, T b) {
  return b == 0 ? a : f_gcd(b, a % b);
}
int x[10] = {0, 1, 0, -1};
int y[10] = {1, 0, -1, 0};
bool vis[MAXN];
int arr[MAXN];
int main() {
  memset(vis, false, sizeof(vis));
  int n;
  scanf("%d", &n);
  int i, j;
  i = n - 1, j = 1;
  int pos1 = 1, pos2 = 2;
  bool flag = true;
  for (; i >= j && i >= 1 && i <= n; i -= 2, j += 2) {
    if (vis[i] || vis[j]) {
      break;
    }
    vis[i] = vis[j] = true;
    arr[pos1] = i;
    arr[pos2] = j;
    pos1 += 2;
    pos2 += 2;
  }
  for (i = 1; i <= (n + 1) / 2; i++) {
    arr[n + 1 - i] = n + 1 - arr[i];
  }
  if (n % 2) arr[(n + 1) / 2] = (n + 1) / 2;
  for (i = 1; i <= n; i++) {
    if (arr[arr[i]] != n - i + 1) {
      flag = false;
      break;
    }
  }
  if (!flag) {
    printf("-1\n");
  } else {
    for (i = 1; i < n; i++) {
      printf("%d ", arr[i]);
    }
    printf("%d\n", arr[i]);
  }
  return 0;
}
