#include <bits/stdc++.h>
using namespace std;
long p[100001];
bool visit[100001];
long n;
bool DFS(int i);
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  if (n > 1) {
    memset(p, -1, sizeof(p));
    memset(visit, false, sizeof(visit));
    bool key = true;
    for (int i = 1; i <= n; i++) {
      if (!visit[i]) {
        if (i + 1 <= n && !visit[i + 1])
          p[i] = i + 1;
        else
          p[i] = i;
        key = key && DFS(i);
      }
    }
    if (key) {
      for (int i = 1; i <= n; i++) cout << p[i] << " ";
    } else
      cout << "-1";
  } else if (n == 1)
    cout << "1";
  return 0;
}
bool DFS(int i) {
  long temp = n - i + 1;
  visit[i] = true;
  if (p[p[i]] == -1) {
    p[p[i]] = temp;
    return DFS(p[i]);
  } else if (p[p[i]] == temp)
    return true;
  else
    return false;
}
