Limits 1s, 128 MB

The ICC or the International Cricket Council is the highest regulator of the game of cricket. ICC has added the 999th999^{th} law to cricket this year. Under this law, no “Man of the Match” award will be given in any international cricket match from now on. But the batsman who does best will get the "Batsman of the Match" award. And the bowler who does best will get the "Bowler of the Match" award. Choosing the best batsman and bowler is a very complex matter. So ICC wants to give you the responsibility of writing a program for this. You just write down the best bowler selection program. Your program should take NN number of bowler's bowling figures and sort the bowling figures from best to worst. I'm going to tell you the rules of sorting so that you can write the program easily.

Step 1: First of all you need to see the wickets. The one who took most wickets will be at the top.

Step 2: After watching the wicket, if there is no solution then you should see the runs given. The one who gave less runs will be at the top.

Step 3: After watching wickets and runs, if there is no solution then you will have to watch maiden overs. The one who gives most maiden overs will be at the top.

Step 4: After completing the previous steps, if there is no solution then you have to look into Overs bowled. The one who bowled less over will be at the top.

Input

There will be given the value of NN (1N101 ≤ N ≤ 10) in the first line of the input. In the next NN lines, the bowling figure of NN bowlers will be given. The bowling figures will be structured as follows:

1{Over}-{MaidenOver}-{Run}-{Wicket}

The bowling figure will not have a fractional number and there will be no similar bowling figure.

Output

Just sort the bowling figures from best to worst and print them out.

Sample

InputOutput
5
4-0-32-2
4-1-31-0
4-0-20-1
4-0-7-6
4-1-20-1
4-0-7-6
4-0-32-2
4-1-20-1
4-0-20-1
4-1-31-0

Submit

Login to submit.

Statistics

58% Solution Ratio
sohomsahaunEarliest, Dec '19
sohomsahaunFastest, 0.0s
sohomsahaunLightest, 0 B
SoudipShortest, 636B
Toph uses cookies. By continuing you agree to our Cookie Policy.