Codeforces Round 176 (Div. 1)
A
Lucky Permutation
Codeforces
1400
原题
←B →
翻译中…

A permutation $*p*$ of size $*n*$ is the sequence $*p*_{1}, *p*_{2}, ..., *p*_{*n*}$, consisting of $*n*$ distinct integers, each of them is from $1$ to $*n*$ $(1 ≤ *p*_{*i*} ≤ *n*)$.

翻译中…

A lucky permutation is such permutation $*p*$, that any integer $*i*$ $(1 ≤ *i* ≤ *n*)$ meets this condition $*p*_{*p*_{*i*}} = *n* - *i* + 1$.

翻译中…

You have integer $*n*$. Find some lucky permutation $*p*$ of size $*n*$.

翻译中…

Input

翻译中…

The first line contains integer $*n*$ ($1 ≤ *n* ≤ 10^{5}$) — the required permutation size.

翻译中…

Output

翻译中…

Print "-1" (without the quotes) if the lucky permutation $*p*$ of size $*n*$ doesn't exist.

翻译中…

Otherwise, print $*n*$ distinct integers $*p*_{1}, *p*_{2}, ..., *p*_{*n*}$ $(1 ≤ *p*_{*i*} ≤ *n*)$ after a space — the required permutation.

翻译中…

If there are multiple answers, you can print any of them.

翻译中…

样例

Input #1
1
Output #1
1
InputCopy OutputCopy
Input #2
2
Output #2
-1
InputCopy OutputCopy
Input #3
4
Output #3
2 4 1 3
InputCopy OutputCopy
Input #4
5
Output #4
2 5 3 1 4
InputCopy OutputCopy
题目信息
题号
286A
时间限制
2 s
内存限制
256 MB
标签
构造
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。