#include <bits/stdc++.h>
using namespace std;
int n, k, b, g, i, j, mark[100007], a[100007], tr;
int main() {
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  a[1] = 2;
  mark[2] = 1;
  k = 1;
  for (i = 2; i <= n; i++) {
    tr = 0;
    if (a[a[k]] == 0) {
      a[a[k]] = n - k + 1;
      if (mark[n - k + 1] == 1) {
        cout << -1 << endl;
        return 0;
      }
      mark[n - k + 1] = 1;
      k = a[k];
      if (i == n) {
        if (a[a[a[k]]] != n - a[k] + 1) {
          cout << -1 << endl;
          return 0;
        }
      }
    } else {
      if (a[a[k]] != n - k + 1) {
        cout << -1 << endl;
        return 0;
      } else {
        for (j = 1; j <= n; j++)
          if (a[j] == 0) {
            b = j;
            break;
          }
        if (i == n) {
          for (j = 1; j <= n; j++)
            if (mark[j] == 0) {
              g = j;
              break;
            }
          a[b] = g;
          if (a[a[b]] != n - b + 1) {
            cout << -1 << endl;
            return 0;
          }
        } else {
          for (j = 1; j <= n; j++) {
            if (mark[j] == 0 && tr == 1) {
              g = j;
              break;
            }
            if (mark[j] == 0 && tr == 0) tr = 1;
          }
        }
        a[b] = g;
        k = b;
        mark[g] = 1;
      }
    }
  }
  for (i = 1; i <= n - 1; i++) cout << a[i] << " ";
  cout << a[n] << endl;
  return 0;
}
