Sport Event Outcome (1) X14333


Statement
 

pdf   zip

html

A sports event has just finished. Along several activities, each of the n participants has obtained a total of points. However, due to the scoring system, the information about the quantity of points per participant comes in some arbitrary order. Of course, we want to know the positions of all of them in the adequate order and, for the podium, the metal of the medals: gold for the participant with highest total of points, and so on.

Input

Input starts with the number n>=0 of participants. Then come n pairs. Each pair (including the first) comes in one new line and consists of a word, the name of a participant, and an integer number, his/her points. A previous processing ensures to us that there are no draws in the points.

Output

Output must be the sequence of names, without the points, but in the order given by the points, highest number of points first; besides, the first name must be preceded by the word "Gold:" (with the colon and one space separation), and likewise "Silver:" for the second and "Bronze:" for the third. (Notice that it is NOT guaranteed that n>=3).

Public test cases
  • Input

    11
    Sidney 6
    Azariah 3
    Kylar 7
    Brighton 9
    Finley 11
    Skyler 4
    Jaidyn 1
    Denver 10
    Hollis 2
    Campbell 8
    Lennon 5
    
    

    Output

    Gold: Finley
    Silver: Denver
    Bronze: Brighton
    Campbell
    Kylar
    Sidney
    Lennon
    Skyler
    Azariah
    Hollis
    Jaidyn
    
  • Input

    2
    Donald 232
    Joe 306
    
    

    Output

    Gold: Joe
    Silver: Donald
    
  • Information
    Author
    José Luis Balcázar
    Language
    English
    Official solutions
    Python
    User solutions
    Python