Restore the permutation
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The permutation p is given. Let fi[i]
be the number of such j that p[j]
> p[i]
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.
Examples
Input #1
Answer #1
Submissions 511
Acceptance rate 67%