Sport Event Outcome (1)

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).

Problem information

Author: José Luis Balcázar

Generation: 2026-01-25T19:41:46.759Z

© Jutge.org, 2006–2026.
https://jutge.org