#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
long long mod = 1e9 + 7;
double eps = 1e-9;
double pi = acos(-1);
long long fastpower(long long b, long long p) {
  double ans = 1;
  while (p) {
    if (p % 2) {
      ans = (ans * b);
    }
    b = b * b;
    p /= 2;
  }
  return ans;
}
bool valid(int x, int y, int n, int m) {
  return (x >= 0 && y < m && x < n && y >= 0);
}
using namespace std;
unordered_map<long long, int> cnt;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n;
  cin >> n;
  vector<long long> ans(n + 1, 0);
  long long l = 1;
  long long r = n;
  for (int i = 0; i < (n / 2); i++) {
    if (i % 2 == 0) {
      ans[l] = r - 1;
      ans[r] = l + 1;
    } else {
      ans[l] = l - 1;
      ans[r] = r + 1;
    }
    l++;
    r--;
  }
  if (n % 2) {
    ans[(n + 1) / 2] = (n + 1) / 2;
  }
  for (int i = 1; i <= n; i++) {
    if (cnt.count(ans[i])) {
      cout << -1;
      return 0;
    }
    cnt[ans[i]] = 1;
    if (ans[ans[i]] != n - i + 1) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
