Find the closest smaller value on the left

Given an array of n integers a1,a2,...,ana_1, a_2, ..., a_n, you are asked to find the closest smaller value to the left of each element.

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 10610^6).

The next line contains n space-separated integers a1,a2,...,ana_1, a_2, ..., a_n (109<ai<109-10^9 < a_i < 10^9).

Output

The program should print n space-separated integers - the indices of the closest smaller value for each element in the given array. If such an element does not exist, the program should print 0.

Examples

Input

Output

8
4 7 2 5 10 5 4 7

0 1 0 3 4 3 3 7

Constraints

Time limit: 4 seconds

Memory limit: 512 MB

Output limit: 10 MB