#include <bits/stdc++.h>
using namespace std;
string tostr(long long x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
long long toint(string &s) {
  stringstream ss;
  ss << s;
  long long x;
  ss >> x;
  return x;
}
void print(vector<int> p) {
  for (int i = 0; i < p.size(); i++) {
    cout << p[i] << " ";
  }
  cout << endl;
}
int main() {
  string fname = "<stdin>";
  string fname2 = "";
  for (int i = 0; i < fname.length() - 4; i++) {
    fname2 += fname[i];
  }
  fname = fname2;
  int n;
  cin >> n;
  if (n % 4 == 2 || n % 4 == 3) {
    cout << -1;
    return 0;
  }
  vector<int> a(n);
  int c = 0;
  int f = 0, b = n - 1;
  int k = 2;
  int e = 0;
  while (c < n / 2) {
    a[f++] = k;
    a[b--] = n + 1 - k;
    k--;
    a[f++] = n + 1 - k;
    a[b--] = k;
    k += 3;
    c += 2;
  }
  if (n % 2) a[n / 2] = n / 2 + 1;
  print(a);
  return 0;
}
