#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chmax(T& a, T b) {
  if (b > a) a = b;
}
template <class T>
inline void chmin(T& a, T b) {
  if (b < a) a = b;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U> p) {
  os << '(' << p.first << ", " << p.second << ')';
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  copy(v.begin(), v.end(), ostream_iterator<T>(os, " "));
  return os;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n % 4 > 1)
    cout << -1 << endl;
  else {
    vector<int> ans(n);
    int rest = n, idx = 0;
    while (rest) {
      if (rest >= 4) {
        ans[idx] = idx + 2;
        ans[idx + 1] = n - idx;
        ans[n - idx - 2] = idx + 1;
        ans[n - idx - 1] = n - idx - 1;
        ans[n - 1] = n - 1;
        idx += 2;
        rest -= 4;
      } else {
        ans[idx] = idx + 1;
        --rest;
      }
    }
    for (int i = 0; i < n; ++i) cout << ans[i] << (i + 1 == n ? "\n" : " ");
  }
  return EXIT_SUCCESS;
}
