#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[100009] = {0};
  bool vis[100009] = {0};
  set<int> st;
  bool f = 1;
  int n = 0;
  cin >> n;
  if (n == 1) {
    cout << n;
    return 0;
  }
  if (n <= 3) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= n; i++) st.insert(i);
  while (st.size()) {
    int i = *st.begin();
    st.erase(i);
    int v = vis[i + 1] ? i : i + 1;
    while (!vis[v]) {
      vis[v] = 1;
      int v2 = n - i + 1;
      arr[i] = v;
      i = v;
      v = v2;
      st.erase(i);
    }
  }
  for (int i = 1; i <= n; i++) f &= vis[i];
  if (!f)
    cout << -1;
  else
    for (int i = 1; i <= n; i++) cout << arr[i] << " ";
  return 0;
}
