SMS Poll

No attempts yetTime limit1sMemory limit128 MB

Problem

The TV show "90%" runs a live SMS poll every week. A poll is one question plus kk choices numbered 1 through kk. Viewers vote by texting a number between 1 and kk 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.

  • In its most general form a phone number looks like "A B C", where A is the country code, B is the area code, and C is the local number. In +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.
  • The country code is optional, and when it is written it is always preceded by a + sign. If it is missing, it is 98. The country code has at most 3 digits.
  • If the country code is written, the area code must be written too. If the country code is omitted, the area code is optional. When the area code is written, it is either preceded by a 0 digit or surrounded by a pair of parentheses, as in 02166166600 and (21)66166600. If the area code is missing, it is 21. The area code has at most 3 digits.
  • Local numbers vary in length from 3 to 8 digits. 6616 and 66166600 are examples.
  • The same number may appear in several formats. 09128122190, +98(912)812-2190 and 0912-812-2190 are all the same number. The formatting rules are:
    • The area code may be surrounded by a pair of parentheses.
    • A dash (-) 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.
  • Every phone number in the raw data is valid and follows the rules above exactly.
  • The complete form of a number fills in the omitted country code and area code, then joins the digits of the three parts. The complete form of +98 (21) 6616 is 98216616. Two messages with equal complete forms came from the same sender.
  • Every phone number in the world has a single complete form. For example (218)4460 and (21)84460 cannot both exist as different numbers, because both have the complete form 982184460.
  • The only valid message content is a single digit from 1 to 4. Anything else, such as letters or a + sign, makes the message invalid, and an invalid message is discarded.
  • A sender may have texted several times from one number. In that case only the earliest valid message counts and the rest are discarded.
  • Discarded messages count toward neither the vote total nor the percentages.

Input

The input holds several test cases. The first line of a test case has the number of messages in the list, nn (1n100001 \le n \le 10000). Each of the next nn lines holds a pair a:b, where aa is a phone number and bb 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.

Output

Print five lines for each test case.

On the iith of the first four lines, print the percentage of votes for choice ii truncated to an integer, followed by %. If cic_i is the number of votes for choice ii and TT is the number of counted votes, the value to print is 100ci/T\lfloor 100 c_i / T \rfloor. When T=0T = 0, print 0% on all four lines.

On the fifth line, print the number of participants xx in the form Participants:x. Here xx is the number of distinct phone numbers appearing in the list, counting numbers that sent no valid message.