#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long infll = 0x3f3f3f3f3f3f3f3f;
const long long mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1.0);
const int maxn = 1e5 + 5;
const int maxm = 1.5e7 + 5;
using namespace std;
int a[maxn];
int main() {
  int n;
  cin >> n;
  int tmp = n;
  if (n / 2 % 2 == 1) {
    cout << -1 << endl;
    return 0;
  } else if (n % 2 == 1) {
    a[(n + 1) / 2] = (n + 1) / 2;
    for (int i = n / 2, j = 1; i >= n / 4 + 1; i--, j++) {
      a[i] = tmp--;
      a[n + 1 - i] = n + 1 - a[i];
      a[j] = i, a[n + 1 - j] = n + 1 - a[j];
    }
  } else {
    for (int i = n / 2, j = 1; i >= n / 4 + 1; i--, j++) {
      a[i] = tmp--;
      a[n + 1 - i] = n + 1 - a[i];
      a[j] = i, a[n + 1 - j] = n + 1 - a[j];
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << endl;
  return 0;
}
