#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
long long a[maxn];
bool vis[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  if (n <= 3) {
    cout << ((n == 1) ? 1 : -1) << endl;
    return 0;
  }
  for (int i = 1; i <= (n / 2); i += 2) a[i] = i + 1, vis[i + 1] = 1;
  for (int i = 1; i <= n; i++) {
    if (a[i]) {
      if (!a[a[i]] && !vis[n - i + 1]) a[a[i]] = n - i + 1;
    }
  }
  long long sum = 0;
  for (int i = 1; i <= n; i++) sum += a[i];
  long long miss;
  if (n & 1)
    miss = (((n + 1) / 2LL) * n) - sum;
  else
    miss = ((n / 2LL) * (n + 1)) - sum;
  for (int i = 1; i <= n; i++) {
    if (!a[i]) {
      a[i] = miss;
      break;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[a[i]] != n - i + 1) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << ' ';
  cout << endl;
  return 0;
}
