#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  int n, i, ara[100009], cnt;
  unordered_map<int, bool> q;
  cin >> n;
  for (i = 1, cnt = 1; i <= n / 2; i++) {
    if (cnt++ % 2) {
      if (q[i + 1]) cout << "-1" << '\n', exit(0);
      ara[i] = i + 1;
      q[i + 1] = 1;
    } else {
      if (q[n - i + 2]) cout << "-1" << '\n', exit(0);
      ara[i] = n - i + 2;
      q[n - i + 2] = 1;
    }
  }
  for (i = n, cnt = 1; i > ceil((float)n / 2.0); i--) {
    if (cnt++ % 2) {
      if (q[i - 1]) cout << "-1" << '\n', exit(0);
      ara[i] = i - 1;
      q[i - 1] = 1;
    } else {
      if (q[n - i]) cout << "-1" << '\n', exit(0);
      ara[i] = n - i;
      q[n - i] = 1;
    }
  }
  if (n % 2) ara[n / 2 + 1] = n / 2 + 1;
  for (i = 1; i <= n; i++)
    if (ara[ara[i]] != n - i + 1) cout << "-1" << '\n', exit(0);
  for (i = 1; i <= n; i++) cout << ara[i] << ' ';
  return 0;
}
