## DOTAA2 - HELP NERUBAN

no tags

Problem Statement:

Neruban, the DotA gamer knows to play with some heroes. You are given the list of heroes that Neruban knows to play with. You are also given how accurate he can play, how fast he can play and how stupidly he can play with every hero. i.e. for each hero you are given 3 values Accuracy(a), Speed(v) and Stupidity(s). Neruban wants to rank the heroes according to the order with which he can play perfectly. So sort the heroes based on higher accuracy, higher speed and lower stupidity

For example a hero with a=10, v=1, s=100 is higher ranked than a hero with a=1,v=100,s=0, because first preference is given for the accuracy of the hero.

Similarly a hero with a=10, v=5, s=20 is higher ranked than a hero with a=10, v=4, s=40, because second preference is given for the speed of the hero.

A hero with a=10, v=3, s=10 is higher ranked than a hero with a=10, v=3, s=15, because stupidity of a player should be lower

If any two heroes have same accuracy, speed and stupidity, sort them based on their name alphabetically.

Input:

The first line consists of an integer n, the number of heroes. The next n lines describe each hero with 4 values - the name of the hero, accuracy, speed and stupidity.

Output:

Sort the heroes based on the above criteria and print the rank list.

Input Constraints:

1<=n<=100000
Name of a hero <= 15 characters (all lower case)
0<=a,v,s<=100

Example:

Sample Input:

4

goblinshredder 45 66 98

pudge 45 86 76

invoker 45 86 75

Sample Output: