URI Online Judge | 2250

Tetris

By OBI - Olimpíada Brasileira de Informática 2003 BR Brazil

Timelimit: 1

Your school class decided to organize a championship tetris. After discussion of the rules, it was decided that each student would play a total of 12 matches. Of the 12 points obtained by a student, the highest and lowest are discarded, and the others are added, resulting in the final score of the student.

As you have programming skills, it ended up being assigned the class to write a program to print the final classification of the championship, from the scores of each player.

Input

The input consists of several test sets. The first line contains a set of tests an integer J (0 ≤ J ≤ 1000), indicating the number of players who participated in the championship. Next, for each player there are two lines at the entrance: the first has the name of the player (formed only by letters, being only the initial capital, and with a maximum of 15 letters), and the second has 12 scores the player obtained, separated by a space. The scores are integers between 0 and 1000. The end of entry is indicated by a test set with J = 0.

Output

For each test set, your program must write one line containing the test set identifier in the "Teste n" format, where n is sequentially numbered from 1. Next, your program should write the final classification in championship, using one line for each attendee. Each line must contain three pieces of information, separated by a blank space: the classification of the player, your final score and your name. The rating of a player is equal to 1 plus the number of players who scored more than his. In case of a tie, the players must be sorted in alphabetical order. After all the classification should be left with a blank line. The format of the sample output below should be followed strictly.

Input Sample Output Sample

4

Zezinho

100 123 133 333 400 300 129 200 360 340 200 600

Luizinho

60 50 120 250 170 190 190 220 260 270 290 300

Carlinhos

10 10 20 10 10 10 10 20 20 20 20 20

Joaozinho

200 300 400 400 500 500 500 600 650 650 700 810

3

Pedrinho

100 100 200 200 300 300 400 400 500 500 600 600

Huguinho

50 100 200 200 300 300 500 500 400 400 600 700

Zezinho

100 100 100 100 100 100 100 100 100 100 100 100

0

Teste 1

1 5200 Joaozinho

2 2518 Zezinho

3 2020 Luizinho

4 150 Carlinhos


Teste 2

1 3500 Huguinho

1 3500 Pedrinho

3 1000 Zezinho