Problems
Restore the permutation
Restore the permutation
The permutation p is given. Let fii
be the number of such j that pj
> pi
and j < i. The array fi is called an inversion table for permutation p. Given the inversion table, restore the permutation.
Input
First line contains the order n (0 < n ≤ 2000) of permutation p. Second line contains the table of inversions fi.
Output
Print the permutation p.
Input example #1
3 0 0 2
Output example #1
2 3 1