9012 - Word Frequency   

Description

Given an article, find the number of appearance for queried strings.

Input

The input includes multiple test cases. In each test case, the first line contains two integers, N and M (0 < N < 10, 0 < M < 100).  N indicates the number of lines in the article, and M indicates the number of strings needs to search.  The next N lines are for the article, and the length of each line < 200.  The followed M lines contains M queried, one per line.  The alphabet of strings is (a-z, A-Z) and digit (0-9).

Output

For each string, output the string and the number of appearance in the article, separate by ‘:’. Uppercase and lowercase are treated as the same alphabet.
Print a blank line after the output of each test case.

Sample Input  Download

Sample Output  Download

Tags




Discuss