#include <bits/stdc++.h>
using namespace std;
int arr[100015];
int N;
int main() {
  cin >> N;
  int s = 1, e = N;
  bool fail = false;
  int left = N;
  while (true) {
    if (left == 0) {
      break;
    } else if (left == 1) {
      arr[s] = s;
      break;
    } else if (left >= 4) {
      arr[s] = s + 1;
      arr[s + 1] = e;
      arr[e] = e - 1;
      arr[e - 1] = s;
      s += 2;
      e -= 2;
      left -= 4;
    } else {
      fail = true;
      break;
    }
  }
  if (fail)
    cout << -1 << endl;
  else {
    for (int i = 1; i <= N; i++) cout << arr[i] << " ";
    cout << endl;
  }
  return 0;
}
