#include <bits/stdc++.h>
using namespace std;
int n;
int v[100005];
int main() {
  cin >> n;
  if (n % 4 == 2 || n % 4 == 3) {
    cout << -1;
    return 0;
  }
  for (int i = 2; i <= n / 2; i += 2) v[i - 1] = i, v[i] = n + 2 - i;
  if (n % 2) v[n / 2 + 1] = n / 2 + 1;
  for (int i = n / 2 - 1, j = 1; i >= 1; i -= 2, j += 2)
    v[(n + 1) / 2 + j] = i, v[(n + 1) / 2 + j + 1] = n - i;
  for (int i = 1; i <= n; i++) cout << v[i] << " ";
  return 0;
}
