#include <bits/stdc++.h>
using namespace std;
int p[200000];
int pp[200000];
int a[200000];
int n;
bool f() {
  for (int(i) = (0); (i) < (n); ++(i))
    if (a[a[i + 1]] != n - i) return 0;
  return 1;
}
void ff(int id, int x) {
  if (a[id]) return;
  a[id] = x;
  ff(x, n - id + 1);
}
int main() {
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  if (n % 4 > 1) {
    cout << -1 << endl;
    return 0;
  }
  int id = 1;
  int x = 2, y = n;
  for (int(i) = (0); (i) < (n / 4); ++(i)) {
    a[id] = x;
    x += 2;
    id++;
    a[id] = y;
    y -= 2;
    id++;
  }
  id = n;
  x = 1;
  y = n - 1;
  for (int(i) = (0); (i) < (n / 4); ++(i)) {
    a[id] = y;
    y -= 2;
    id--;
    a[id] = x;
    x += 2;
    id--;
  }
  if (n % 2) a[(n + 1) / 2] = (n + 1) / 2;
  for (int(i) = (1); (i) < (n + 1); ++(i)) cout << a[i] << " ";
  return 0;
}
