#include <bits/stdc++.h>
using namespace std;
int n;
int *a;
void foo(int k, int i) {
  a[i] = k;
  a[k] = n - i + 1;
  a[n - k + 1] = i;
  a[n - i + 1] = n - k + 1;
}
void Zero() {
  for (int i = 1; i <= n; ++i) {
    a[i] = 0;
  }
}
void Print() {
  for (int i = 1; i <= n; ++i) {
    cout << a[i] << " ";
  }
}
int main() {
  cin >> n;
  if (n % 4 == 3 || n % 4 == 2) {
    cout << -1;
    return 0;
  }
  a = new int[n + 1];
  Zero();
  if (n % 4 == 0) {
    for (int j = 1; j <= n / 2;) {
      foo(j + 1, j);
      j += 2;
    }
    Print();
  }
  if (n % 4 == 1) {
    for (int j = 1; j <= (n - 1) / 2;) {
      foo(j + 1, j);
      j += 2;
    }
    a[n / 2 + 1] = n / 2 + 1;
    Print();
  }
  return 0;
}
