Chess tournament

Write a program that given the results of the matches of a chess tournament, prints the names of the players in alphabetical order and next to each name, the number of wins, draws and defeats.

Input

Input consists of the number nn of players followed by nn strings with the player names. Then, it follows zero or more match results. Each match result is represented by three strings. First two are the match player names. The third string can be ’1-0’ (first player is the winner), ’0-1’ (second player is the winner) or ’1/2-1/2’ (for a draw). The number of players nn is always greater than 1.

Output

In alphabetical order and for each player, a line with the name and numbers of wins, draws an defeats as it is shown in the examples.

Problem information

Author: Proal

Generation: 2026-01-25T15:48:08.349Z

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