Under construction

Still being built. Things may change

The Last Shall Be First

Time limit0.5sMemory limit1024 MB

Summary
Given the first-phase ranking of n teams from one state, print each team's predicted second-phase position, which reverses their first-phase order.
Level

Easy2 of 10

Topics
Array, Implementation
Solved
No attempts yet

Problem

Eric Ruiz Irrigado, known to his friends as Erí, likes to make predictions. He tries to guess the winners, losers, top scorers, and similar outcomes in every kind of competition or sports event. He keeps looking for patterns where others see only coincidence.

While following the teams of the Programming Marathon, Erí noticed that the ranking of the teams from his state in the first phase was always reversed in the second phase, even when teams from other regions were in between them. For example, if the team from Uni1 finishes ahead of Uni2 in the first phase, Erí expects Uni2 to finish ahead of Uni1 in the second phase.

To test this hypothesis, he wants a program that takes the first-phase ranking of the teams and prints the relative position of those same teams in the second phase.

Input

The input contains several test cases. The first line of each test case contains n, the number of teams from Erí's state, with n at most 100. The next n lines each contain one distinct integer between 1 and n, inclusive, representing one team.

The input ends with n = 0. Do not process this line.

Output

For each test case, print the predicted relative position of each team according to Erí's hypothesis, one number per line. After the list of teams, print a single line containing 0.

Examples1

  1. Example 1

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