#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 1, 0, -1, -1, -1, 1, 1};
int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
int res[100010];
bool vis[100010];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n == 1)
    cout << 1;
  else {
    int co = 1;
    if (n & 1) vis[n / 2 + 1] = res[n / 2 + 1] = n / 2 + 1;
    if ((n / 2) % 4 != 2 && (n / 2) % 4 != 0) {
      cout << -1 << endl;
      return 0;
    }
    for (long long i = 1; i < n + 1; i++) {
      if (vis[i]) continue;
      int x = n - i + 1;
      res[i] = i + 1;
      while (!vis[i]) {
        vis[i] = 1;
        int x = n - i + 1;
        res[res[i]] = x;
        i = res[i];
      }
    }
    for (long long i = 1; i < n + 1; i++) cout << res[i] << " ";
  }
  return 0;
}
