A sensor records n signal-strength readings in order, one per time step. Define the span of a reading as the number of consecutive time steps, ending at and including the current one, found by scanning backward from the current reading and counting for as long as each prior reading is less than or equal to the current reading. Counting stops (without including) at the first prior reading that is strictly greater than the current reading, or when the start of the sequence is reached.
For example, for the readings 3 4 4 (in order), the span of the final 4 is 3: scanning backward, the middle 4 is <= 4 (count it), and the 3 before that is also <= 4 (count it), and the sequence start is reached, so all 3 readings are counted.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the readings in chronological order.
Output format
n space-separated integers on one line: the span of each reading, in chronological order.
Constraints
- 1 ≤ n ≤ 100000
- 1 ≤ reading ≤ 1000000000