#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
using namespace std;
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
const int MAXN = 1e6 + 9;
const int MOD = (int)(1e9 + 7);
const int LOG2MAXN = 17;
const int INF = 1e9;
const long double eps = 1e-9;
int di[] = {0, 1, 0, -1};
int dj[] = {1, 0, -1, 0};
char ddir[] = {'R', 'U', 'L', 'D'};
mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
long long mod = 1e9 + 7;
void solve() {
  int n;
  cin >> n;
  if (n % 4 > 1) {
    cout << -1 << endl;
    return;
  }
  vector<int> ans(n);
  if (n % 4) ans[n / 2] = n / 2;
  int l = 0, r = n - 1;
  for (int i = 0; i < n / 4; i++) {
    ans[l] = l + 1;
    ans[l + 1] = r;
    ans[r] = r - 1;
    ans[r - 1] = l;
    l += 2;
    r -= 2;
    if (l >= r) break;
  }
  vector<int> bb(n + 1);
  for (int i = 0; i < n; i++) bb[i + 1] = ans[i] + 1;
  bool ok = 1;
  for (int i = 1; i <= n; i++)
    if (bb[bb[i]] != n - i + 1) ok = 0;
  assert(ok);
  for (int x : ans) cout << x + 1 << ' ';
  cout << endl;
}
void input() {
  for (int n = 1; n <= 11; n++) {
    vector<int> aa(n);
    cout << n << " : \n";
    iota((aa).begin(), (aa).end(), 0);
    do {
      vector<int> bb(n + 1);
      for (int i = 0; i < n; i++) bb[i + 1] = aa[i] + 1;
      bool ok = 1;
      for (int i = 1; i <= n; i++)
        if (bb[bb[i]] != n - i + 1) ok = 0;
      if (ok) {
        for (int i = 1; i <= n; i++) cout << bb[i] << ' ';
        cout << endl;
      }
    } while (next_permutation((aa).begin(), (aa).end()));
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
