#include <bits/stdc++.h>
using namespace std;
int n, a[100100];
bool calc(int st) {
  for (int i = 0; i < n; i++) a[i] = -1;
  int x = st;
  a[x] = 0;
  for (int i = 0; i < n; i++) {
    if (a[a[x]] != -1) break;
    a[a[x]] = n - x - 1;
    x = a[x];
  }
  if (n % 2 == 0) {
    for (int i = 0; i < n; i++)
      if (a[i] == -1) return true;
  } else {
    for (int i = 0; i < n; i++)
      if (a[i] == -1) {
        if (n / 2 != i)
          return true;
        else
          a[i] = i;
      }
  }
  return true;
}
int main() {
  cin >> n;
  if (n % 4 > 1) {
    cout << -1;
    return 0;
  }
  if (n % 2) a[n / 2] = n / 2;
  for (int i = 0; i < n / 4; i++) {
    int p1 = i * 2 + 1, p2 = p1 - 1, p3 = n - p1 - 1, p4 = n - p2 - 1;
    a[p1] = p2;
    a[p2] = p3;
    a[p3] = p4;
    a[p4] = p1;
  }
  for (int i = 0; i < n; i++) cout << a[i] + 1 << " ";
}
