#include <bits/stdc++.h>
using namespace std;
const int maxN = 200000;
int a[maxN];
int n;
int main() {
  cin >> n;
  if (n == 1) {
    cout << 1;
    return 0;
  }
  if (n <= 3) {
    cout << -1;
    return 0;
  }
  if (n % 4 == 2 || n % 4 == 3) {
    cout << -1;
    return 0;
  }
  int l = 1;
  int r = n;
  while (true) {
    if (l > r) break;
    if (r - l == 0) {
      a[l] = l;
      break;
    }
    a[l] = l + 1;
    a[l + 1] = r;
    a[r] = r - 1;
    a[r - 1] = l;
    l += 2;
    r -= 2;
  }
  for (int i = 1; i <= n; i++) cout << a[i] << ' ';
  return 0;
}
