#include <bits/stdc++.h>
using namespace std;
long long int inf = 1e14;
long long int mod = 1e9 + 7;
char en = '\n';
long long int arr[300005];
long long int res[300005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  memset(arr, 0, sizeof(arr));
  long long int n;
  cin >> n;
  if ((n % 4 == 2) or (n % 4 == 3)) {
    cout << -1 << en;
    return 0;
  }
  long long int leftPtr = 100000, rightPtr;
  vector<long long int> left1, right1;
  vector<long long int> curr;
  if (n & 1) {
    curr.push_back(1);
    rightPtr = 100000;
  } else {
    rightPtr = 100003;
    curr.push_back(2);
    curr.push_back(4);
    curr.push_back(1);
    curr.push_back(3);
  }
  long long int currSize = curr.size() + 4;
  while (currSize <= n) {
    arr[leftPtr] += 2;
    arr[rightPtr + 1] -= 2;
    leftPtr -= 2;
    rightPtr += 2;
    left1.push_back(currSize);
    left1.push_back(2);
    right1.push_back(1);
    right1.push_back(currSize - 1);
    currSize += 4;
  }
  long long int cnt = 0;
  reverse(left1.begin(), left1.end());
  for (long long int x : left1) res[++cnt] = x;
  for (long long int x : curr) res[++cnt] = x;
  for (long long int x : right1) res[++cnt] = x;
  for (long long int i = leftPtr; i <= rightPtr; i++) {
    arr[i] += arr[i - 1];
    cout << res[i - leftPtr + 1] + arr[i] << " ";
  }
  return 0;
}
