A row of n crates is stacked left to right, each with a positive integer weight. For every crate, look backward (toward crates placed earlier, to its left) and find the nearest earlier crate whose weight is strictly smaller than the current crate's weight. Report the 1-indexed position of that crate, or 0 if no earlier crate is strictly lighter.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the crate weights from left to right.
Output format
n space-separated integers on one line: for each crate (left to right), the 1-indexed position of the nearest earlier strictly-lighter crate, or 0.
Constraints
- 1 ≤ n ≤ 100000
- 1 ≤ weight ≤ 1000000000