Under construction

Still being built. Things may change

Student Lineup

Interview

Time limit1sMemory limit128 MB

Summary
Simulate inserting students one by one into a line, each moving forward from the end by a given number of positions, then output the final order.
Level

Easy3 of 10

Topics
Simulation, Array
Solved
No attempts yet

Problem

At lunchtime, students draw numbers in the order in which they first stood in line.

Call the first student student 1, the second student student 2, and so on up to student N. The i-th student draws one number that is at least 0 and less than i. Starting from the end of the current line, that student moves forward by exactly the drawn number of positions and stands there.

After every student has drawn a number and moved in order, write a program that prints the final order of the students.

Input

The first line contains the number of students N. N is at most 100.

The second line contains N integers separated by spaces, in the order the students first stood in line. The number drawn by the i-th student is at least 0 and less than i.

Output

Number the students from 1 to N in their initial order. Print the student numbers in the final line order on one line, separated by spaces.

Examples1

  1. Example 1

    Input
    5
    0 1 1 3 2
    
    Expected output
    4 2 5 3 1