You are given an array $$$a$$$ of length $$$N$$$. Each element of $$$a$$$ is either $$$-1$$$ or an integer between $$$1$$$ and $$$N$$$. Each number between $$$1$$$ and $$$N$$$ appears at most once in $$$a$$$. Also, no two adjacent elements of $$$a$$$ differ by exactly $$$1$$$.
You are to find the lexicographically smallest permutation $$$p$$$ of $$$\{1, 2, \ldots, N\}$$$ satisfying the following.
The first line contains one integer, $$$N$$$.
The second line contains space-separated $$$N$$$ integers: elements of the array $$$a$$$.
If there is no permutation $$$p$$$ satisfying the condition, then output a single integer $$$-1$$$.
Otherwise, output the lexicographically smallest permutation $$$p$$$.
10 3 -1 10 -1 8 -1 -1 -1 -1 -1
3 1 10 2 8 4 6 9 5 7
2 -1 -1
-1