#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  if (n <= 3) {
    cout << -1 << endl;
    return 0;
  }
  if (n % 2 == 0) {
    if (n % 4 != 0) {
      cout << -1 << endl;
      return 0;
    }
    for (int i = 1; i <= n / 2; i = i + 2) {
      a[i] = i + 1;
      a[i + 1] = n + 2 - (i + 1);
      a[n - i + 1] = a[i + 1] - 1;
      a[n - (i + 1) + 1] = a[i] - 1;
    }
  }
  if (n % 2 == 1) {
    if ((n - 1) % 4 != 0) {
      cout << -1 << endl;
      return 0;
    }
    a[n / 2 + 1] = n / 2 + 1;
    for (int i = 1; i <= n / 2; i = i + 2) {
      a[i] = i + 1;
      a[i + 1] = n + 2 - (i + 1);
      a[n - i + 1] = a[i + 1] - 1;
      a[n - (i + 1) + 1] = a[i] - 1;
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << endl;
}
