Given n pairs of numbers (, ), (, ), …, (, ), you are asked to sort them in increasing order if the value of a pair is considered the number . You are asked to print the initial indices of the pairs after sorting them. In case there are several solutions, you are asked to print the one with smaller initial indices first.

Input

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

The next n lines contain two integers (, ) (0 ≤ ≤ ) (1 ≤ ≤ ).

Output

The program should print the initial indices after sorting the pairs.