873. Warmer Day

0

Medium

Given an array of integers representing daily temperatures, return an array where each element represents the number of days you have to wait after the corresponding day to experience a warmer temperature. If there is no future day with a higher temperature, the corresponding element in the output array should be 0.

Input Format

The first line contains an integer N, representing the number of elements in the array. The second line contains N space-separated integers, representing the daily temperatures.

Output Format

Print an array of integers.

Example

Input

8 73 74 75 71 69 72 76 73

Output

1 1 4 2 1 1 0 0

Constraints

1 <= temperatures.length <= 105
30 <= temperatures[i] <= 100
Loading...

View Submissions

Console