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