#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n;
int p[maxn];
void dfs(int pr, int v) {
  if (p[pr]) return;
  p[pr] = v;
  dfs(v, n - pr + 1);
}
void solve(int n, int z = 1, int shft = 0) {
  if (n < 0) return;
  if (n == 0) return;
  if (n == 1) {
    p[z] = 1 + shft;
    return;
  }
  p[z] = 2 + shft;
  p[z + 1] = n + shft;
  p[z + n - 1] = n - 1 + shft;
  p[z + n - 2] = 1 + shft;
  solve(n - 4, z + 2, shft + 2);
}
int main(int argc, char** argv) {
  cin >> n;
  if (n % 4 == 2 || n % 4 == 3) {
    cout << -1 << "\n";
    return 0;
  }
  solve(n);
  for (int i = 1; i <= n; i++) {
    cout << p[i] << " ";
  }
  cout << "\n";
  return 0;
}
