#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T max(T a, T b, T c) {
  return max(a, max(b, c));
}
template <class T>
inline T min(T a, T b, T c) {
  return min(a, min(b, c));
}
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
template <class T>
T gcd(T a, T b) {
  return (b == (T)0 ? a : gcd(b, a % b));
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
T mathround(T x) {
  long long i64x = (long long)x;
  if (x < i64x + 0.5) return (T)i64x;
  return (T)i64x + 1;
}
template <class T>
bool isprime(T x) {
  int till = (T)sqrt(x + .0);
  if (x == 1) return 0;
  if (x == 2) return 1;
  if (x % 2 == 0) return 0;
  for (int i = 3; i <= till; i += 2)
    if (x % i == 0) return 0;
  return 1;
}
int n;
int p[100001];
int main() {
  cin >> n;
  if (n % 4 > 1) {
    cout << -1;
    return 0;
  }
  int till = n / 4;
  if (n % 4 == 1) p[n / 2 + 1] = n / 2 + 1;
  int id, xx;
  for (int i = 1; i <= till; i++) {
    id = i * 2 - 1;
    xx = i * 2;
    for (int j = 0; j < 4; j++) {
      p[id] = xx;
      int nid = xx;
      int nxx = n - id + 1;
      xx = nxx;
      id = nid;
    }
  }
  for (int i = 1; i <= n; i++) cout << p[i] << " ";
  return EXIT_SUCCESS;
}
