#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, n, m, t, a[100001];
  cin >> n;
  if ((n % 4 != 0) && (n - 1) % 4 != 0) {
    cout << "-1";
    return 0;
  }
  if (n % 4 == 0) {
    for (i = 1, j = n; i <= n / 2; i += 2, j -= 2) {
      a[i] = i + 1;
      a[j - 1] = i;
      a[i + 1] = j;
      a[j] = j - 1;
    }
  } else {
    for (i = 1, j = n; i <= n / 2; i += 2, j -= 2) {
      a[i] = i + 1;
      a[j - 1] = i;
      a[i + 1] = j;
      a[j] = j - 1;
    }
    a[(n / 2) + 1] = (n / 2) + 1;
  }
  for (i = 1; i <= n; i++) cout << a[i] << " ";
  return 0;
}
