Problem Митинг (две характеристики) ≡

Author:mesenev   Time limit:2 sec
Input file:input.txt   Memory limit:256 Mb
Output file:output.txt  

Statement

The virtual student council has decided to hold a rally against freedom of speech. This raised the question of choosing a chairperson. The student council is full of people, yet there is no one to choose from. After deliberating, the virtual characters numbered themselves, and for the character numbered i defined the following numbers:

The larger the number, the higher the character's skill level in the corresponding field.

Character i is considered a candidate for chairperson if and only if there is no character j such that simultaneously mj > mi and pj > pi.

Write a program that compiles the list of candidates for chairperson.

Input file format

The input file contains a natural number n  — the number of characters. It is followed by n pairs of natural numbers mi pi.

Output file format

Output to the output file the numbers of the selected characters in increasing order.

Constraints

1 ≤ n ≤ 105

1 ≤ mi, pi ≤ 109

Sample tests

No. Input file (input.txt) Output file (output.txt)
1
4
2 3 
1 1 
2 1 
3 2
1 4

0.038s 0.010s 18