UEFA Champions League is the most prestigious annual sport competition in the world. In this competition, European clubs are divided into 8 groups of 4 teams.
In group stage, teams are ranked according to some specific rules. For example Team A will be ranked above Team B if:
It is guaranteed that there won’t be a tie after these rules.
Your task is to write a program to determine the group leaders (top 2 teams of each group) based on their results.
The input is describing 12 games which are played between teams of a group. Each line describes a game and its result. The length of each line doesn’t exceed 25.
The format of each line is: HomeTeamName HomeTeamGoals vs. AwayTeamGoals AwayTeamName
Teams’ names consist of English letters and space character.
The team with more scored goals wins the game and receives 3 points. In case of draw, both teams receive 1 point.
Print the names of first team and the second team in the appropriate order. They must be printed in separate lines.