There are n soldiers currently standing in a queue in the increasing order of their height. No two soldiers will have the same height.
As expected, each soldier knows his position in the queue, and hence is aware of the number of soldiers who are lesser in height than him. One day due to some chaos, they couldn’t form a proper queue and lined up randomly.
To fix the issue, the commander asks each soldier to tell the count of soldiers who are lesser in height than him (the soldier) , standing behind him (the soldier). This way he gets a count.
Now the commander must tell each soldier’s actual rank.
The first line of input is n , the total number of soldiers.
n lines follow, where each line contains an integer representing the count of soldiers of lesser height, behind the current soldier.
Output n lines, where each line is an integer representing the actual rank of the soldier in the queue.
7 0 1 1 0 1 3 1
4 7 6 1 3 5 2