The TV show "90%" runs a live SMS poll every week. A poll is one question plus k choices numbered 1 through k. Viewers vote by texting a number between 1 and k to the show's phone number, and the tally appears on screen during the broadcast.
Parliament grew suspicious of the figures announced on last week's broadcast and appointed a committee to look into them. The committee obtained the full list of messages sent to the final broadcast and now wants to process the data. The poll under investigation has four choices.
There are far too many messages to count by hand, so the committee asked for a program that extracts the tally from the raw data. The data is a list of phone:content pairs, where phone is the sender's phone number and content is the message body. Compute the percentage of votes for each choice. The following rules apply.
+98 (21) 6616-6645 the country code is 98, the area code is 21, and the local number is 6616-6645. None of A, B, C starts with the digit 0.+ sign. If it is missing, it is 98. The country code has at most 3 digits.02166166600 and (21)66166600. If the area code is missing, it is 21. The area code has at most 3 digits.6616 and 66166600 are examples.09128122190, +98(912)812-2190 and 0912-812-2190 are all the same number. The formatting rules are:
-) may sit between any two digits of the local number, or between two of the three parts (country code, area code, local number). A dash and a parenthesis never sit next to each other.+98 (21) 6616 is 98216616. Two messages with equal complete forms came from the same sender.(218)4460 and (21)84460 cannot both exist as different numbers, because both have the complete form 982184460.+ sign, makes the message invalid, and an invalid message is discarded.The input holds several test cases. The first line of a test case has the number of messages in the list, n (1≤n≤10000). Each of the next n lines holds a pair a:b, where a is a phone number and b is the message content. A phone number never contains :, so the first : on a line ends the phone number and everything after it is the content. The content is at most 30 characters long, and each character is a letter, a digit, or one of :, +, -, (, ). The input ends with a line holding a single 0, which is not processed. The input has no space characters.
Print five lines for each test case.
On the ith of the first four lines, print the percentage of votes for choice i truncated to an integer, followed by %. If ci is the number of votes for choice i and T is the number of counted votes, the value to print is ⌊100ci/T⌋. When T=0, print 0% on all four lines.
On the fifth line, print the number of participants x in the form Participants:x. Here x is the number of distinct phone numbers appearing in the list, counting numbers that sent no valid message.