HUST Monthly 2011.04.09

From: 2011-04-09 13:00:00 To: 2011-04-09 17:00:00 Now: 2017-09-22 06:49:14 Status: Public

D - reverse order 2

Time Limit: 1s Memory Limit: 128MB

Submissions: 179 Solved: 72

Here is a sequence a1..n, which is a disordered sequence from 1 to N. if i < j and ai > aj, <i, j> is called a pair of inversion. And b1..n-1 is defined as follows, bk is the number of the total inversion pairs in array a, when i<=k<j. Now the array a is required while the array b is known.



Several cases end with the end of the file;

And each of the cases includes two lines, a integer n(2<=n<=10^5)in the first line, and the second line followed with n-1 integer, which is in the presentation of array b;


Output the answer of each case in a line, namely the array a, and a space is required between adjacent integers.

Sample Input
2 1 2 0
Sample Output
3 1 4 2 5