#include <bits/stdc++.h>
using namespace std;
int ans[500001];
int main() {
  long long n;
  cin >> n;
  if (n % 4 != 0 && n % 4 != 1) {
    cout << "-1";
    return 0;
  }
  for (int i = 1; i <= n >> 1; i += 2) {
    ans[i] = i + 1;
    ans[i + 1] = n - i + 1;
    ans[n - i + 1] = n - i;
    ans[n - i] = i;
  }
  if (n % 4) ans[(n >> 1) + 1] = (n >> 1) + 1;
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
}
