All problems

Bubble Chart: Size Encodes a Third Variable

mediumPythonMatplotlibBubble Chart

Meridian Insight is mapping a retailer's stores. Each store is a dot placed by two measures, and a third measure — last year's turnover — decides how big the dot is drawn, so the map shows three things at once. The client's question is blunt: which store is the big one? Dot area is notoriously hard to judge by eye, so the answer is printed rather than pointed at.

Task: Print the row number of the store with the largest third measure. Rows are numbered from 0, so the first store in the list is row 0. If two or more stores share the largest value, print the row number of the earliest of them.

Input

The first line holds an integer n, the number of stores. Each of the next n lines holds three numbers separated by single spaces: the two placing measures, then the size measure. All may have decimals. n is at least 1.

Output

One line holding a whole number: the row number.

Example:

Input:
3
1 1 10
2 2 50
3 3 20

Output:
1

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…