During the FIFA World Cup 2006, many people run a World Cup pool, where friends or colleagues predict the outcomes of the tournament's games. The World Cup is split into several rounds, and each round consists of several games.
After each game you earn points for correctly predicting the winner and for predicting the exact score. After each round, whoever scored the most points in that round also earns a dot, which is used later as a tie-breaker; if several people tie for the round's highest score, every one of them earns a dot.
When the tournament ends, the player with the most points overall wins the pot.
You are running such a pool for your friends. The finals are tomorrow, yet you still do not know everyone's standings. Given the participants, their bets, and the actual game results, write a program that computes each participant's total points and dots and prints the standings sorted from best to worst.
Scoring for a single game:
The first line contains the number of scenarios.
Each scenario begins with a line containing the number of participants p (1≤p≤50) and the number of rounds r (1≤r≤14). The next p lines give the participants' names, one per line; the i-th line is the name of participant i. Every name is shorter than 50 characters.
Then follow the r rounds. Each round begins with a line containing the number of games g (1≤g≤16) in that round, followed by the g games.
A game is described by a line with its actual result, followed by exactly p lines of predictions; the i-th of these lines is participant i's prediction. Every result and prediction is written as X : Y (with one space before and after the colon), where X and Y are non-negative integers.
For each scenario, first print a line Scenario #i:, where i is the scenario number starting at 1. Then print p lines, each giving the points, the dots, and the name of a participant, sorted as follows:
On each line, separate the points, the dots, and the name with single spaces. Print a blank line after each scenario.