#include <bits/stdc++.h>
using namespace std;
long long INV2 = 500000004;
long long INV6 = 166666668;
long long power(long long a, long long b, long long c) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b & 1) x = (x * y) % c;
    y = (y * y) % c;
    b /= 2;
  }
  return x % c;
}
int dx[] = {0, -1, 0, 1};
int dy[] = {-1, 0, 1, 0};
int dr[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dc[] = {0, 1, 1, 1, 0, -1, -1, -1};
int ans[100005];
bool fl;
int has[100005];
int main() {
  int n;
  scanf("%d", &n);
  if (n == 2 || n == 3 || n == 6) {
    printf("-1\n");
  } else {
    int mid = n / 2 + 1;
    if (n & 1) {
      ans[mid] = mid;
      for (int i = 1; i < mid; i += 2) {
        ans[i] = i + 1;
        has[i + 1]++;
        if (has[i + 1] > 1) fl = 1;
      }
      int val = n;
      for (int i = 2; i < mid; i += 2) {
        ans[i] = val;
        val -= 2;
        has[val]++;
        if (has[val] > 1) fl = 1;
      }
      for (int i = n; i > mid; i -= 2) {
        ans[i] = i - 1;
        has[i - 1]++;
        if (has[i - 1] > 1) fl = 1;
      }
      val = 1;
      for (int i = n - 1; i > mid; i -= 2) {
        ans[i] = val;
        has[val]++;
        if (has[val] > 1) fl = 1;
        val += 2;
      }
    } else {
      mid = n / 2;
      for (int i = 1; i <= mid; i += 2) {
        ans[i] = i + 1;
        has[i + 1]++;
        if (has[i + 1] > 1) fl = 1;
      }
      int val = n;
      for (int i = 2; i <= mid; i += 2) {
        ans[i] = val;
        has[val]++;
        if (has[val] > 1) fl = 1;
        val -= 2;
      }
      for (int i = n; i > mid; i -= 2) {
        ans[i] = i - 1;
        has[i - 1]++;
        if (has[i - 1] > 1) fl = 1;
      }
      val = 1;
      for (int i = n - 1; i > mid; i -= 2) {
        ans[i] = val;
        has[val]++;
        if (has[val] > 1) fl = 1;
        val += 2;
      }
    }
    for (int i = 1; i <= n; ++i) {
      if (ans[ans[i]] != (n - i + 1)) {
        fl = 1;
        break;
      }
    }
    if (fl) {
      printf("-1\n");
      return 0;
    }
    for (int i = 1; i <= n; ++i) {
      printf("%d ", ans[i]);
    }
    printf("\n");
  }
  return 0;
}
