#include <bits/stdc++.h>
using namespace std;
int M[100001];
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  if (n % 4 == 2) {
    cout << -1 << endl;
    return 0;
  }
  if (n % 2 == 0) {
    int j = n;
    for (int i = n / 2; i > 0; i -= 2) {
      M[i] = j;
      j -= 2;
    }
    for (int i = 1; i < n / 2; i += 2) {
      M[i] = j;
      j -= 2;
    }
    j = 1;
    for (int i = n / 2 + 1; i < n; i += 2) {
      M[i] = j;
      j += 2;
    }
    for (int i = n; i > n / 2; i -= 2) {
      M[i] = j;
      j += 2;
    }
    for (int i = 1; i <= n; i++) {
      cout << M[i] << " ";
    }
    return 0;
  } else {
    if ((n + 1) % 4 == 0) {
      cout << -1 << endl;
      return 0;
    } else {
      int j = 2;
      for (int i = 1; i < n / 2; i += 2) {
        M[i] = j;
        j += 2;
      }
      for (int i = n / 2 + 3; i <= n; i += 2) {
        M[i] = j;
        j += 2;
      }
      j = 1;
      for (int i = n - 1; i >= 0; i--) {
        if (M[i] == 0) {
          M[i] = j;
          j += 2;
        }
      }
      for (int i = 1; i <= n; i++) {
        cout << M[i] << " ";
      }
      return 0;
    }
  }
  return 0;
}
