#include <bits/stdc++.h>
using namespace std;
const int dr[]{-1, -1, 0, 1, 1, 1, 0, -1};
const int dc[]{0, 1, 1, 1, 0, -1, -1, -1};
void run() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
deque<int> solve(int n, int add) {
  if (n == 0) return {};
  if (n == 1) return {1 + add};
  deque<int> q = solve(n - 4, add + 2);
  q.push_front(n + add);
  q.push_front(2 + add);
  q.push_back(1 + add);
  q.push_back(n - 1 + add);
  return q;
}
int main() {
  run();
  int n;
  cin >> n;
  if (n % 4 == 2 || n % 4 == 3) return cout << "-1", 0;
  deque<int> q = solve(n, 0);
  for (auto &it : q) cout << it << ' ';
}
