Lost Victor


Submit solution

Points: 1
Time limit: 1.5s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C++, Java, Python

Tony's standing on the greatest competitive programming stage in the world, also known as AUCPL Div B. The contest has just finished; however, it turns out the scoreboard broke at the end and is not displaying how many questions the top team solved, or how long they took to solve them.

Everyone turns to you, as you're known for being a superstar problem solver, to fix the problem. You use your top-tier skills and turn it off and on again. Shockingly, that did not work. However, you have now got a list of all the problems each team solved and the time it took to solve each one.

Can you work out what the top team's score was and their time?

Input

The first line contains an integer n (2 \leq n \leq 10^5) — the number of teams.

The next n lines contain 6 space-separated integers, the time to solve each question f_i (-1 \leq f_i \leq 120).

Output

Output the best score and the time taken, separated by a space.

Clarifications

  • -1 indicates the question was not solved.
  • There were no penalties in this comp.

Example

Input 1
5
45 10 -1 -1 42 -1
-1 -1 74 -1 119 -1
41 63 53 -1 -1 52
52 5 46 90 119 8
-1 -1 3 -1 -1 -1
Output 1
6 320
Explanation
Team Points Time taken
1 3 97
2 2 193
3 4 209
4 6 320
5 1 3

Team 4 has the most points so we output their score (6) and their time taken (320)


Comments

There are no comments at the moment.