#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897932384626;
long long MOD = 1000000007;
const long double EPS = 1e-9;
const int N = 3e5 + 7;
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline unsigned int setBits(unsigned int v) {
  unsigned int c;
  for (c = 0; v; ++c) v &= (v - 1);
  return c;
}
inline bool isPowerOfTwo(unsigned int v) { return (v && !(v & (v - 1))); }
bool isPalin(const string& s) {
  int i, j;
  for (i = 0, j = s.length() - 1; i <= j; ++i, --j)
    if (s[i] != s[j]) return false;
  return true;
}
long long power(long long base, unsigned long long exp, long long mod = MOD) {
  long long res = 1;
  base %= mod;
  while (exp) {
    if (exp & 1) res = (res * base) % mod;
    exp >>= 1;
    base = (base * base) % mod;
  }
  return res;
}
long long modInv(long long a, long long mod = MOD) {
  if (mod == 1) return 0;
  long long x = 1, y = 0, m = mod;
  while (a > 1) {
    long long q = a / m, t = m;
    m = a % m;
    a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += mod;
  return x;
}
inline unsigned int iabs(int x) {
  unsigned int y = x;
  return (y > 0) ? y : -y;
}
inline long long add(long long a, long long b, long long mod = MOD) {
  long long res = (a % mod + b % mod) % mod;
  return res;
}
inline long long sub(long long a, long long b, long long mod = MOD) {
  long long res = (a % mod - b % mod + mod) % mod;
  return res;
}
inline long long mult(long long a, long long b, long long mod = MOD) {
  long long res = (a % mod * b % mod) % mod;
  return res;
}
inline long long div(long long a, long long b, long long mod = MOD) {
  long long res = (a % mod * modInv(b, mod)) % mod;
  return res;
}
void openf() {}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  openf();
  int n;
  cin >> n;
  if (n % 4 > 1) {
    cout << -1 << endl;
    return 0;
  }
  vector<int> ans(n + 1);
  int i = 0;
  for (int k = 0; k + 4 <= n; k += 4) {
    ans[i + 1] = i + 2;
    ans[i + 2] = n - i;
    ans[n - i] = n - i - 1;
    ans[n - i - 1] = i + 1;
    i += 2;
  }
  if (n % 4) {
    ans[(n + 1) / 2] = (n + 1) / 2;
  }
  for (int i = 1; i <= n; ++i) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
