#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005];
int used[10005];
bool check(int i) {
  if (a[i] == -1) return true;
  if (a[a[i] - 1] == -1) {
    a[a[i] - 1] = n - i;
    used[n - i] = true;
  } else
    return a[a[i] - 1] == n - i;
  return check(a[i] - 1);
}
bool checkans() {
  for (int i = 0; i < n; ++i) {
    if (a[i] != -1) {
      if (!check(i)) return false;
    } else {
      for (int j = 1; j <= n; ++j) {
        if (used[j]) continue;
        used[j] = true;
        a[i] = j;
        if (check(i)) break;
        a[i] = -1;
        used[j] = false;
      }
    }
  }
  return true;
}
int main() {
  cin >> n;
  if (n == 1 || ((n - (n % 2)) % 4 == 0)) {
    for (int i = 2; i <= n / 2; i += 2) {
      printf("%d %d ", i, n - i + 2);
    }
    if (n % 2) printf("%d ", n / 2 + 1);
    for (int i = n / 2 - 1; i >= 1; i -= 2) {
      printf("%d %d ", i, n - i);
    }
  } else
    printf("-1");
  return 0;
}
