#include <bits/stdc++.h>
using namespace std;
int main() {
  ifstream fin("input.txt", ios::in);
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  cout << setprecision(10);
  cout << fixed;
  int n;
  cin >> n;
  if (n % 4 == 2 || n % 4 == 3) return cout << -1, 0;
  if (n == 1) return cout << 1, 0;
  int d[n];
  if (n % 2 == 0) {
    for (int i = 0; i < n / 4; i++) {
      d[i * 2] = (i + 1) * 2;
      d[i * 2 + 1] = n - i * 2;
      d[n - i * 2 - 1] = n + 1 - 2 * (i + 1);
      d[n - i * 2 - 2] = i * 2 + 1;
    }
  } else {
    d[n / 2] = n / 2 + 1;
    for (int i = 0; i < n / 4; i++) {
      d[i * 2] = (i + 1) * 2;
      d[i * 2 + 1] = n - i * 2;
      d[n - i * 2 - 1] = n + 1 - 2 * (i + 1);
      d[n - i * 2 - 2] = i * 2 + 1;
    }
  }
  for (int i = 0; i < n; i++) cout << d[i] << " ";
}
