#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:200000000")
using namespace std;
const int INF = (int)1e9;
const long long INF64 = (long long)1e18;
const long double eps = 1e-9;
const long double pi = 3.14159265358979323846;
int n;
void solve() {
  if (n % 4 != 0 && n % 2 == 0) {
    puts("-1");
    return;
  }
  if (n % 2 == 1 && (n - 1) % 4 != 0) {
    puts("-1");
    return;
  }
  vector<int> p(n + 1, 0);
  if (n % 2 == 1) {
    p[(n + 1) / 2] = (n + 1) >> 1;
  }
  for (int i = 1; i <= n; i++) {
    if (p[i] == 0) {
      p[i] = i + 1;
      int t = i;
      do {
        p[p[t]] = n - t + 1;
        t = p[t];
      } while (t != i);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i != 1) printf(" ");
    printf("%d", p[i]);
  }
  puts("");
}
int main() {
  cin >> n;
  solve();
}
