#include <bits/stdc++.h>
using namespace std;
int a[100009];
bool FL;
void f(int st, int en, int i, int j) {
  if (st > en) return;
  if (st == en)
    a[i] = st;
  else {
    if ((j - i) == 1 || (j - i) == 2) {
      FL = false;
      return;
    }
    a[i] = st + 1;
    a[i + 1] = en;
    a[j] = en - 1;
    a[j - 1] = st;
    f(st + 2, en - 2, i + 2, j - 2);
  }
}
int main() {
  int n;
  cin >> n;
  FL = true;
  f(1, n, 1, n);
  if (FL) {
    for (typeof(1) i = (1); i < (n); i++) cout << a[i] << " ";
    cout << a[n] << "\n";
    for (typeof(1) i = (1); i < (n + 1); i++) assert(a[a[i]] == (n - i + 1));
  } else
    cout << "-1\n";
  return 0;
}
