1672 TV play I


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

Nowadays XMJ is addicted in TV Plays,and she only wants to watch the most famous one. But she doesn’t know which TV Play to choose. So she asks you to help her. Can you work?

Input

The input consists of several cases. The first line of each case gives a number N (N<=100), then there are N lines following. Each line consists of the name of the TV Play and the score of it which is given by one viewer (the score is a one-decimal number (<=10.0) ).A TV Play’s final score is the average score given by viewers (If the score is lager, it means it is more popular). If two TV Plays have the same scores, choose the one which is less in lexicographic order.

Output

For each test case, you should output one line containing the number of the case and the name of the most famous TV play and a one-decimal number which indicates its score.

Sample

Input

10
Ugly Betty 9.0
Ugly Betty 8.9
Ugly Betty 9.4
Friends 9.6
Palace 9.2
Schemes of a Beauty 9.3
Friend 9.0
The desire of back 9.8
Schemes of a Beauty 9.3
Palace 10.0
2
Ugly Betty 8.1
Palace 8.1

Output

1 The desire of back 9.8
2 Palace 8.1

Source: xmj


Comments

There are no comments at the moment.