At an open-source fair held at a large university, the leaders of open-source projects hang sign-up sheets on the wall. Each sheet has the project name written at the top in capital letters so that it can be identified.
Students then sign up for a project by writing down their userid. A userid is a string of lowercase letters and digits that starts with a letter.
Afterwards, the organizer takes all the sheets off the wall and types in the information.
Your job is to report how many students signed up for each project. Some students were overly enthusiastic and wrote their userid several times on the same sheet; that is fine, but each such student is counted only once for that project. Students were asked to commit to a single project, so any student who signed up for more than one project must not be counted for any project.
The university has at most 10,000 students, and at most 100 projects were advertised.
The input contains several test cases. Each test case ends with a line that starts with the digit 1. The last test case is followed by a line that starts with the digit 0.
Each test case consists of one or more project sheets. A project sheet is a line containing the project name (in capital letters), followed by the userids of the students who signed up, one per line.
For each test case, print a summary for every project sheet. Each summary is a single line containing the project name followed by the number of students who signed up for it. Print these lines in decreasing order of the number of sign-ups. If two or more projects have the same number of sign-ups, list them in alphabetical order.