beecrowd | 2018

Christmas Olympics

By Neilor Tonin, URI BR Brazil

Timelimit: 1

According to the tradition, the Christmas Olympics Games are very interesting and differents. Among the existing modalities, we can mention for example, the lifting bag of toys, climbing pine trees, riding with reindeer and the throwing of elves (with and without their consent - the second modality is more dangerous), among others. Part of the improvement of the competition proposed by Claus for this year will be the availability of the medals panel of participating countries through an electronic scoreboard. You were invited to travel to the mountains of Korvatunturi in Lapland, Finland, place that will host these games, for, starting from a list of modalities and the winners countries, develop the system for this eletronic scoreboard. It will be expected almost three hundred participating countries and the competition will have at maximum 1000 types of olympic competitions.

Input

The input contains only one test case, consisting by a relation with the result of all competitions realized in the Christmas Olympics Games. Each competition or modality will contain four information lines: the first line will contain the contest description. The second line will contain the winner country in that modality. The third line will contain the vice-champion and the last line will contain the bronze medalist country. The end of input is indicated by EOF.

Output

Your program must print the medal table for the Christmas Olympics Games. The first line must contain the text "Quadro de Medalhas". Each one of the next lines will contain the name of a country followed by the respective number of gold medals, silver medals and bronze medals that this country won, separated by a blank space. The criteria for tiebrake is the number of gold medals, followed by the number of silver and bronze medals. If two or more countries have the same number of medals (gold, silver and bronze) the listing must be by ascending order of country name.

Input Sample Output Sample

Arremesso de duende
Finlandia
Noruega
Sri Lanca
Levantamento de Saco de Brinquedos
Russia
Africa do Sul
Estonia
Escalada de Pinheiro
Estados Unidos
Canada
Sri Lanca
Hipismo com Renas
Finlandia
Estados Unidos
Finlandia
Mergulho em Buraco no Gelo
Islandia
Estonia
Russia

Quadro de Medalhas
Finlandia 2 0 1
Estados Unidos 1 1 0
Russia 1 0 1
Islandia 1 0 0
Estonia 0 1 1
Africa do Sul 0 1 0
Canada 0 1 0
Noruega 0 1 0
Sri Lanca 0 0 2