Testing System
Junior programmer Sasha wrote his first testing system. He was so happy to compile it that he decided to invite school friends to his own contest.
But at the end of the contest, it became clear that the system couldn't sort the teams in the results table. Help Sasha implement this sort.
The teams are ordered according to ACM rules:
by the number of solved tasks in descending order;
if the number of solved problems is equal, sort by the penalty time in ascending order;
if all the previous parameters are equal, sort by the team number in ascending order.
Input
The first line contains the number of teams that take part in the contest. The -th of the next lines contains the number of solved problems and the penalty time for the team with number .
Output
Print numbers — the team numbers in the sorted order.