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 have a difference of 1.
You are to find the lexicographically smallest permutation p of 1,2,⋯,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.