An array of integers p 1 , p 2 , … , p n p_1,p_2,…,p_n p1,p2,…,pn is called a permutation if it contains each number from 1 to n exactly once. For example, the following arrays are permutations: [3,1,2],[1],[1,2,3,4,5] and [4,3,1,2]. The following arrays are not permutations: [2],[1,1],[2,3,4].
There is a hidden permutation of length n.
For each index i, you are given si, which equals to the sum of all pj such that j<i and pj<pi. In other words, si is the sum of elements before the i-th element that are smaller than the i-th element.
Your task is to restore the permutation.
Input
The first line contains a single integer n ( 1 ≤ n ≤ 2 ⋅ 1 0 5 ) n (1≤n≤2⋅10^5) n(1≤n≤2⋅105)— the size of the permutation.
The second line contains n integers s 1 , s 2 , … , s n ( 0 ≤ s i ≤ n ( n − 1 ) / 2 ) s_1,s_2,…,s_n(0≤si≤n(n−1)/2) s1,s2,…,sn(0≤si≤n(n−1)/2).
It is guaranteed that the array s corresponds to a valid permutation of length n.
Output
Print n integers p 1 , p 2 , … , p n p_1,p_2,…,p_n p1