To sort items of varying heights from lowest to highest, engineers have invented a sorting robotic arm. It follows a simple sorting rule: in the first operation, it finds the position $P_1$ of the lowest item and reverses the items from the start to $P_1$; in the second operation, it finds the position $P_2$ of the second-lowest item and reverses the items from the second position to $P_2$... eventually, all items will be sorted.
The image above shows an example: before the first operation, the lowest item is at position 4, so the items from 1 to 4 are reversed; before the second operation, the second-lowest item is at position 6, so the items from 2 to 6 are reversed...
Your task is to write a program to determine the sequence of operations, i.e., the position $P_i$ of the lowest item before each operation, so that the robotic arm can work. Note that if there are items with the same height, you must ensure that their relative order after sorting remains the same as it was initially.
Input
The first line contains a positive integer $n$, representing the number of items to be sorted. The second line contains $n$ space-separated integers $a_i$, representing the height of each item.
Output
Output a single line containing $n$ space-separated integers $P_i$.
Examples
Input 1
6 3 4 5 1 6 2
Output 1
4 6 4 5 6 6
Input 2
4 3 3 2 1
Output 2
4 2 4 4
Constraints
For 30% of the data: * $1 \le n \le 1000$
For 100% of the data: $1 \le n \le 100000$ $1 \le a_i \le 2000000000$