#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 2;
int a[maxn];
int n;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  int t = n % 4;
  for (int i = 1; i <= n; i++) a[i] = i;
  if (t == 1 or !t) {
    int pt1 = 1;
    int pt2 = n;
    while (pt1 < pt2) {
      swap(a[pt1], a[pt1 + 1]);
      swap(a[pt2], a[pt2 - 1]);
      swap(a[pt2 - 1], a[pt1 + 1]);
      pt2 -= 2;
      pt1 += 2;
    }
    for (int i = 1; i <= n; i++) cout << a[i] << ' ';
  } else
    cout << -1;
  return 0;
}
