#include <bits/stdc++.h>
using namespace std;
template <typename T>
std::vector<std::vector<std::vector<T>>> make_3d_vector(long long z,
                                                        long long y,
                                                        long long x,
                                                        T value = T{}) {
  return std::vector<std::vector<std::vector<T>>>(
      z, std::vector<std::vector<T>>(y, std::vector<T>(x, value)));
}
template <typename T>
std::vector<std::vector<T>> make_2d_vector(long long z, long long y,
                                           T value = T{}) {
  return std::vector<std::vector<T>>(z, std::vector<T>(y, value));
}
template <typename T>
std::vector<T> make_1d_vector(long long z, T value = T{}) {
  return std::vector<T>(z, value);
}
vector<long long> v(100001);
long long n;
void solve2(long long a, long long b, long long c, long long d) {
  if (n % 2) {
    v[a] = b;
    v[b] = d;
    v[c] = a;
    v[d] = c;
  } else {
    v[a] = b;
    v[b] = d;
    v[c] = a;
    v[d] = c;
  }
}
void solve() {
  cin >> n;
  if (n % 2 == 0 && n % 4) {
    cout << -1;
    return;
  }
  if (n % 2 && (n - 1) % 4) {
    cout << -1;
    return;
  }
  for (long long i = 1; i <= n / 2; i += 2) {
    solve2(i, i + 1, n - i, n - i + 1);
  }
  for (long long i = 1; i <= n; i++) {
    if (v[i] == 0) {
      v[i] = i;
    }
    cout << v[i] << " ";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
}
