| Author: | Виртуальная реальность | Time limit: | 2 sec | |
| Input file: | input.txt | Memory limit: | 256 Mb | |
| Output file: | output.txt |
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:
Character i is considered a candidate for chairperson if and only if there is no character j such that simultaneously mj > mi, pj > pi and tj > ti.
Write a program that compiles the list of candidates for chairperson.
The input file contains a natural number n — the number of characters. It is followed by n triples of natural numbers mi pi ti.
Output to the output file the numbers of the selected characters in increasing order.
1 ≤ n ≤ 105
1 ≤ mi, pi, ti ≤ 109
| No. | Input file (input.txt) |
Output file (output.txt) |
|---|---|---|
| 1 |
|
|