#include <bits/stdc++.h>
using namespace std;
const int maxn = 100111;
int p[maxn];
bool vist[maxn];
int n;
void dfs(int cur) {
  vist[cur] = 1;
  if (p[p[cur]]) {
    return;
  }
  p[p[cur]] = n - cur + 1;
  dfs(p[cur]);
}
int main() {
  scanf("%d", &n);
  if (n % 4 == 2 || n % 4 == 3)
    puts("-1");
  else {
    if (n & 1) {
      p[n / 2 + 1] = n / 2 + 1;
      for (int i = 1, j = 2; i <= n / 2; i += 2, j += 2) p[i] = j;
      for (int i = 2, j = n; i <= n / 2; i += 2, j -= 2) p[i] = j;
      for (int i = n, j = n - 1; i > n / 2 + 1; i -= 2, j -= 2) p[i] = j;
      for (int i = n - 1, j = 1; i > n / 2 + 1; i -= 2, j += 2) p[i] = j;
    } else {
      for (int i = 1, j = 2; i <= n / 2; i += 2, j += 2) p[i] = j;
      for (int i = 2, j = n; i <= n / 2; i += 2, j -= 2) p[i] = j;
      for (int i = n, j = n - 1; i > n / 2; i -= 2, j -= 2) p[i] = j;
      for (int i = n - 1, j = 1; i > n / 2; i -= 2, j += 2) p[i] = j;
    }
    for (int i = (1); i <= (n); i++) printf("%d ", p[i]);
    puts("");
  }
  return 0;
}
