#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int p[123123];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  if ((n / 2) % 2) {
    cout << -1 << '\n';
    return 0;
  }
  int s = 1;
  int l = n;
  if (n % 2 == 1) p[n / 2 + 1] = n / 2 + 1;
  for (int i = 1; i <= n / 2; i += 2) {
    p[i] = s + 1;
    p[i + 1] = l;
    p[n - i + 1] = l - 1;
    p[n - i] = s;
    s += 2;
    l -= 2;
  }
  for (int i = 1; i <= n; i++) assert(p[p[i]] == n - i + 1);
  for (int i = 1; i <= n; i++) cout << p[i] << " ";
  cout << '\n';
  return 0;
}
