选美比赛评分


Submit solution

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

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

Description

选美决赛中有一批选手参加比赛,比赛规则是由5位评委打分(十分制),求出总分作为选手最后得分,按照选手得分进行排名,分数越高,名次越靠前。

Input

输入数据中第一行表示选手数m(m≤50)。 接下来有m行,对应m位选手的数据: 每一位选手数据中,第一个为字符串S(S中间没有空格),表示选手姓名(选手没有重名)。后面跟着5个整数n1,n2,n3,n4,n5(0≤ni≤10),分别为5位评委的打分。

Output

以5位评委打分的总和为最后得分,对选手进行排名,分数高的先输出。若分数相同,则按选手名字的ASCII串值从小到大输出。 输出时,一位选手占一行,列出姓名和最后得分。姓名输出宽度为10个字符,左对齐,在空出一格后列出最后得分。

Sample

Input

4
Jane 2 4 8 7 3
Tina 9 8 9 6 4
Sarh 10 7 7 9 8
Alice 8 6 9 8 5

Output

Sarh       41
Alice      36
Tina       36
Jane       24

Source: cjj


Comments

There are no comments at the moment.