Selecting Teammate

0

0 votes
Easy
Problem

Shreyansh being a topcoder, is interested in participating in ACM ICPC this year. As the maximum team size can be two, he wants to select his team partner. All other coders want to be in his team, because they are sure of his success. So he asks all interested participants to give three scores for themselves: Academic performance score(CGPA), Extra-curricular score (provided by Students' Gymkhana), Competitive coding experience score(hackerearth rating). Also every student has a bondness level (Pranav, the bondest person, has given everyone this score). Totally n students have now applied for this. If all three scores of a student are strictly less than those of some other student, then the first student is considered to be ineligible. Among all eligible students, then, Shreyansh chooses the bondest student.

There are many students and Shreyansh is busy preparing for ICPC. So he asks you to help him in choosing the teammate.

INPUT:
The first line contains number n (1 n 1000)
CGPA, extra-curr. score and hackerearth rating and bondness level are integers.
1 CGPA 10
100 Extra-curricular score 1000
1000 Hackerearth rating 3000
1 Bondness level 9999 (because Pranav is 10000 :P)

All students have different bondness levels.

OUTPUT:
Print a single number- the number of a student Shreyansh will choose. The students are numbered with positive integers from 1 to n in the order in which they are given in data input.

Sample Input
5
8  200 1500 8000
7  850 2700 6500
9  516 2200 6800
10 850 1280 7000
7  200 1800 8500
Sample Output
4
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Note: In example above, Shreyansh considers first and fifth students ineligible as all three of their scores cannot match those of third student. Now the fourth one has highest bondness level. So Shreyansh chooses fourth one.

Contributers:
Editor Image

?