2017 Ajou University Programming Contest (Small)

Given up to three contestants' scores, submission counts, and last scoring upload times, output the number of the top-ranked contestant by the tie-break rules.

Easy2SortingImplementationInterviewNo attempts yetTime limit1sMemory limit512 MB

Problem

The Ajou Programming Contest (APC) ran for Ajou University students from its first edition in 2009 through its sixth edition in 2014. In 2017, Hyeonjeong watched the campus contests other schools were running and decided to bring APC back after three years.

The 2017 APC works like this.

  • Every problem consists of a Small data set and a Large data set.
  • To solve a data set you download its input file and upload the matching output file and source code within 5 minutes.
  • You can download the Large input file of a problem only after you solve its Small data set.
  • Solving the Small data set or the Large data set of a problem earns points, and the two amounts differ.
  • The submission count is the total number of input downloads made, up to and including the accepted one, on the problems where the contestant earned points.
  • Downloads on problems that earned no points are not counted.

The standings follow from that format.

  • A contestant with a larger total score ranks higher.
  • If two contestants have the same total score, the one with fewer submissions ranks higher.
  • If the total score and the submission count are both equal, the one whose last scoring upload came earlier ranks higher.

Hyeonjeong has not slept properly for days and is short-tempered. Write a program that computes the standings so she can rest for a while.

Input

The first line contains a natural number NN (1N31 \le N \le 3), the number of contestants.

Each of the next NN lines contains three integers SiS_i, CiC_i, LiL_i (0Si6200 \le S_i \le 620, 0Ci500 \le C_i \le 50, 0Li1790 \le L_i \le 179). Line 1+i1+i gives, in order, the score of contestant ii, that contestant's submission count, and the upload time of the last problem on which that contestant earned points. No two contestants have all three values equal.

Output

Print the number of the contestant who finishes first, on one line.