#include <bits/stdc++.h>
using namespace std;
const int max_n = 1e5 + 15;
int n, p[max_n];
int main() {
  cin >> n;
  if ((n & 3) > 1) {
    cout << -1;
    return 0;
  }
  if (n == 1) {
    cout << 1;
    return 0;
  }
  for (int i = 0; i + i + 1 < n; i += 2) {
    p[i] = i + 2;
    p[n - i - 1] = n + 1 - p[i];
    p[i + 1] = p[n - i - 1] + 1;
    p[n - i - 2] = n + 1 - p[i + 1];
  }
  if (n & 1) p[n / 2] = n / 2 + 1;
  for (int i = 0; i < n; i++) cout << p[i] << " ";
  return 0;
}
