Problem M
Klósettröð
Languages
en
is
Input
The input consists of two lines. The first line contains a single integer $1 \le n \le 1\, 000$. The second line contains $n$ integers $1 \le a_i \le n$. It will hold for all $i \neq j$ that $a_i \neq a_j$. Worded differently, the values are unique.
Output
Print the order of the contestants such that they are ordered by how badly they need to use the bathroom. The person who needs to use the bathroom the most should be at the front.
Scoring
Group |
Points |
Constraints |
1 |
100 |
No further constraints |
Sample Input 1 | Sample Output 1 |
---|---|
3 1 2 3 |
3 2 1 |
Sample Input 2 | Sample Output 2 |
---|---|
5 1 3 2 5 4 |
4 5 2 3 1 |