Problems
ACM Sort
ACM Sort
You are the author of a testing system that sorts teams according to ACM rules. The teams are numbered from $1$ to $n$ according to the order they appear in the input. Ranked teams are ordered according to the following rules:
\begin{itemize}
\item by the number of solved problems in descending order;
\item if the number of solved problems is equal --- by the penalty time in ascending order;
\item if all mentioned parameters are equal --- by the team number in ascending order.
\end{itemize}
\InputFile
First line contains the number of teams $n~(1 \le n \le 1000)$ that participate in competition. The information about $i$-th team is given in the $i~(1 \le i \le n)$-th next line:
\begin{itemize}
\item the team name, no more than $20$ characters;
\item the number of solved problems $s~(0 \le s \le 100)$;
\item the penalty time $t~(0 \le t \le 1000)$ of the team.
\end{itemize}
\OutputFile
Print the information about the teams in sorted order as shown in the example.
Input example #1
6 Facebook 6 789 Google 5 123 E-olymp 7 345 IBM 7 340 Codeforces 5 54 Microsoft 5 123
Output example #1
IBM 7 340 E-olymp 7 345 Facebook 6 789 Codeforces 5 54 Google 5 123 Microsoft 5 123