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:
by the number of solved problems — in decreasing order;
if the number of solved problems is the same — by the penalty time in increasing order;
if still tied — by the team number in increasing order.
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).
Print the team information in the sorted order, as shown in the example.
Beispiel 1