#include <bits/stdc++.h>
using namespace std;
const int N = 200011;
const int MOD = 1e9 + 7;
long long int powmod(long long int a, long long int b) {
  if (b == 0) return 1;
  long long int x = powmod(a, b / 2);
  long long int y = (x * x) % MOD;
  if (b % 2) return (a * y) % MOD;
  return y % MOD;
}
int main() {
  int n;
  scanf("%d", &n);
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  int a[n + 2];
  if (n % 4 <= 1) {
    if (n % 4) {
      int mid = (n + 1) / 2, add = n - 2, sign = 1;
      a[mid] = mid;
      mid++;
      a[mid] = 1;
      for (int i = mid + 1; i <= n; i++) {
        a[i] = a[i - 1] + add * sign;
        add -= 2;
        sign *= -1;
      }
      a[1] = n / 2, add = 3, sign = 1;
      for (int i = 2; i <= n / 2; i++) {
        a[i] = a[i - 1] + add * sign;
        add += 2;
        sign *= -1;
      }
    } else {
      int mid = n / 2 + 1, add = n - 2, sign = 1;
      a[mid] = 1;
      for (int i = mid + 1; i <= n; i++) {
        a[i] = a[i - 1] + add * sign;
        add -= 2;
        sign *= -1;
      }
      a[1] = n / 2, add = 2, sign = 1;
      for (int i = 2; i <= n / 2; i++) {
        a[i] = a[i - 1] + add * sign;
        add += 2;
        sign *= -1;
      }
    }
    for (int i = 1; i <= n; i++) printf("%d ", a[i]);
    printf("\n");
    return 0;
  }
  printf("-1\n");
  return 0;
}
