#include <bits/stdc++.h>
using namespace std;
int n, a[100005], i;
void Solve(int left, int right) {
  if (left > right) return;
  if (right - left < 3) {
    if (left == right) a[left] = right;
    if (left + 1 == right) a[left] = left, a[right] = right;
    if (left + 2 == right)
      a[left] = right, a[left + 1] = left + 1, a[right] = left;
    return;
  }
  a[left] = left + 1;
  a[left + 1] = right;
  a[right] = right - 1;
  a[right - 1] = left;
  Solve(left + 2, right - 2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  Solve(1, n);
  for (i = 1; i <= n; ++i)
    if (a[a[i]] != n - i + 1) return cout << "-1\n", 0;
  for (i = 1; i <= n; ++i) cout << a[i] << " \n"[i == n];
  return 0;
}
