#include <bits/stdc++.h>
using namespace std;
char f(vector<int> a) {
  int n = a.size() - 1;
  for (int i = 1; i <= n; i++)
    if (a[a[i]] != n - i + 1) return false;
  return true;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n + 1, -1);
  a[1] = 2;
  a[n - 1] = 1;
  a[n] = n - 1;
  if (n % 2 == 0) {
    for (int i = 3; i <= n / 2; i += 2) a[i] = a[i - 2] + 2;
    for (int i = n - 3; i > n / 2; i -= 2) a[i] = a[i + 2] + 2;
  } else {
    for (int i = 3; i < n / 2 + n % 2; i += 2) a[i] = a[i - 2] + 2;
    a[n / 2 + 1] = n / 2 + 1;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == -1) continue;
    if (a[a[i]] == -1) a[a[i]] = n - i + 1;
    if (a[a[i]] != n - i + 1) {
      printf("-1");
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d ", a[i]);
  return 0;
}
