#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  return (b == 0) ? a : gcd(b, a % b);
}
const unsigned int MOD = 1000000007;
long long int inf = 1000000000000000000;
template <class T>
T power(T a, long long int n) {
  T res = 1;
  while (n > 0) {
    if (n % 2) res = (res * a) % MOD;
    a = (a * a) % MOD, n = n / 2;
  }
  return (res) % MOD;
}
unsigned int factorial(unsigned int n) {
  if (n == 0) return 1;
  return n * factorial(n - 1);
}
bool isprime(int n) {
  if (n <= 1) return false;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
inline long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
inline long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
int getsum(long long int n) {
  int sum;
  for (sum = 0; n > 0; sum += n % 10, n /= 10)
    ;
  return sum;
}
void tobin(int n) {
  int binaryNum[32];
  int i = 0;
  while (n > 0) {
    binaryNum[i] = n % 2;
    n = n / 2;
    i++;
  }
  for (int j = i - 1; j >= 0; j--) cout << binaryNum[j];
}
long long int nCr(long long int n, long long int k) {
  long long int res = 1;
  if (k > n - k) k = n - k;
  for (int i = 0; i < k; i++) res *= (n - i), res /= (i + 1);
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  if (n == 1) return cout << 1, 0;
  if (n == 2 || n == 3) return cout << -1, 0;
  vector<long long int> arr(n + 1, 0);
  ;
  long long int k = 2;
  for (int i = 1; i <= n / 2; i += 2) {
    arr[i] = k;
    arr[i + 1] = n + 2 - k;
    arr[n - i + 1] = n + 1 - arr[i];
    arr[n - i] = n + 1 - arr[i + 1];
    k += 2;
  }
  if (n % 2) arr[(n + 1) / 2] = (n + 1) / 2;
  bool flag = 1;
  for (int i = 1; i <= n; i++) {
    if (arr[arr[i]] != n - i + 1) {
      flag = 0;
      break;
    }
  }
  if (flag)
    for (int i = 1; i <= n; i++) cout << arr[i] << " ";
  else
    cout << -1;
}
