#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589793238;
template <typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vector) {
  for (size_t i = 0; i < vector.size(); ++i) {
    os << vector[i] << " ";
  }
  return os;
}
vector<int> FindHappyPermutaion(int n) {
  if (n == 1) {
    return vector<int>(2, 1);
  } else if (n % 4 == 2 || n % 4 == 3) {
    return vector<int>(2, -1);
  } else {
    vector<int> v(n + 1, 0);
    if (n % 4 == 0) {
      int k = n / 4;
      int l = n / 2;
      int r = l + 1;
      for (int i = 1; i <= k; ++i) {
        v[i] = l;
        v[l] = n - i + 1;
        v[n - i + 1] = r;
        v[r] = i;
        --l;
        ++r;
      }
    } else if (n % 4 == 1) {
      int k = n / 4;
      int l = n / 2;
      int r = l + 2;
      for (int i = 1; i <= k; ++i) {
        v[i] = l;
        v[l] = n - i + 1;
        v[n - i + 1] = r;
        v[r] = i;
        --l;
        ++r;
      }
      v[n / 2 + 1] = n / 2 + 1;
    }
    return v;
  }
}
void TestPermutation(const vector<int>& v) {
  int n = v.size() - 1;
  if (n != 1) {
    for (int i = 1; i <= n; ++i) {
      bool s = v[v[i]] == n - i + 1;
      cout << "n = " << n << ", i = " << i << ": " << s << "\n";
      if (!s) {
        cerr << "\nFAIL"
             << "\nn = " << n << "\nn mod 4 = " << n % 4 << "\n";
        throw std::runtime_error("FAIL");
      }
    }
  }
}
void StressTest() {
  for (int n = 1; n <= 100000; ++n) {
    vector<int> v = FindHappyPermutaion(n);
    TestPermutation(v);
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> v = FindHappyPermutaion(n);
  for (int i = 1; i < v.size(); ++i) {
    cout << v[i] << " ";
  }
  cout << "\n";
  return 0;
}
