You are given an integer and an array of length .
Let
Find a permutation of the integers from to such that for every (1 \le i \le n),
If no such permutation exists, print -1.
The first line contains one integer (1 \le n \le 2 \cdot 10^5).
The second line contains integers b_1,b_2,\ldots,b_n (0 \le b_i \le n).
If a valid permutation exists, print integers p_1,p_2,\ldots,p_n.
Otherwise, print -1.
If there are several valid permutations, print any of them.
Example 1
Example 2
In the first example, no valid permutation exists.
In the second example, the permutation
is valid, since its prefix products modulo are
Subtask ( points): n \le 8.
Subtask ( points): n \le 100.
Subtask ( points): n+1 is prime.
Subtask ( points): n \le 5000.
Subtask ( points): b_i>0 for every .
Subtask ( points): No additional constraints.