#include <bits/stdc++.h>
using namespace std;
ifstream fin("input.txt");
ofstream fout("output.txt");
const long long mod = 1000000000 + 7;
const int maxn = 100000 + 10;
const int inf = 1000000009;
int n, a[maxn], pos = 1, p, c = 2;
int main() {
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  if (n % 4 == 2 || n % 4 == 3) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 1; i <= n / 2; i += 2) {
    pos = i;
    c = pos + 1;
    for (int j = 1; j <= 4; j++) {
      a[pos] = c;
      p = pos;
      pos = c;
      c = n - p + 1;
    }
  }
  if (n % 2) a[n / 2 + 1] = n / 2 + 1;
  for (int i = 1; i <= n; i++) cout << a[i] << ' ';
  cout << endl;
  return 0;
}
