#include <bits/stdc++.h>
using namespace std;
const long long maxx = 1ll << 32;
const int maxn = 100005;
int n, k = 0, m, l, r, x, y, t;
int a[maxn];
long long c[maxn];
int dp[maxn];
int vis[maxn];
int gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
struct lee {
  int num;
  int x, y;
} lo[maxn];
struct le {
  int v, sum;
} lm[maxn];
char ss;
string s1, s2;
stack<long long> stackk;
int main() {
  while (~scanf("%d", &n)) {
    if (n % 4 != 0 && n % 4 != 1)
      printf("-1\n");
    else {
      int k = 1;
      for (int i = 1; i <= n; i++) vis[i] = 0;
      if (n & 1) a[n / 2 + 1] = n / 2 + 1;
      for (int i = n / 2; vis[i] == 0 && i; i--) {
        a[i] = k;
        a[n + 1 - k] = i;
        a[n + 1 - i] = n + 1 - k;
        a[k] = n + 1 - i;
        vis[i] = vis[n + 1 - k] = vis[n + 1 - i] = vis[k] = 1;
        k++;
      }
      for (int i = 1; i <= n; i++)
        i == n ? printf("%d\n", a[i]) : printf("%d ", a[i]);
    }
  }
}
