Soccer, also called football, is the most popular sport in the world. According to a study published in 2001, more than 240 million people regularly play football in over 200 countries.
You have been hired to provide IT support for the Soccer League. The rules for this season are:
Given a list of match results from the Soccer League, produce the league table defined by these rules.
The input contains several test cases. The first line of a test case contains a single integer $N$, the number of matches in that test case ($1 \le N \le 1000$). Each of the next $N$ lines describes one match in the format
Club1 X x Y Club2
where Club1 and Club2 are strings of at most 15 characters (letters a–z and A–Z), X is the number of goals scored by Club1, and Y is the number of goals scored by Club2 ($0 \le X \le 10$ and $0 \le Y \le 10$). The lowercase x between the two scores is a literal separator. The input ends with a line containing $N = 0$, which is not processed.
For each test case, output its league table. Each line of a table has the format
P Club
where P is the number of points accumulated by Club. List the clubs in order of descending points. Clubs with equal points are ordered by descending goal difference. Clubs with equal points and equal goal difference are ordered by the order in which they first appear in the input (a club that appears earlier comes first). Separate consecutive league tables with a single blank line.