LogiQuest

45. Top Student

EasyDictionarySorting

Given students and their marks, print the name(s) with the highest average mark, in alphabetical order, followed by the average rounded to 2 decimal places.

Input format

Line 1: n Next n lines: name mark1 mark2 mark3

Output format

Line 1: top name(s), space-separated Line 2: the average with 2 decimals

Example 1

Input

3
asha 90 85 80
ravi 70 95 90
meena 60 70 80

Output

asha ravi
85.00

Example 2

Input

2
b 50 50 50
a 50 50 50

Output

a b
50.00

Constraints

1 ≤ n ≤ 1000, 0 ≤ marks ≤ 100

Read input from standard input and print the answer to standard output. Your code is judged against 3 test cases, most of them hidden.

Loading the MyLoginn IDE…