ICPC Sort#10246

ICPC Sort

1 Sekunde
128 Megabyte
Sehr leicht

You are the author of a judging system that sorts teams according to ICPC rules. The teams are numbered from to in the order in which they appear in the input. The ranking is formed according to the following rules:

Eingabe

The first line contains the number of teams n~(1 \le n \le 1000) participating in the contest. The next lines provide information about the teams. Each line contains:

  • the team name (no more than characters);

  • the number of solved problems s~(0 \le s \le 100);

  • the penalty time t~(0 \le t \le 1000).

Ausgabe

Print the team information in the sorted order, as shown in the example.

Beispiele

Beispiel 1

Loading
Loading