文理学院程序设计在线练习


Appearance Times

Time Limit: 1 Second(s)    Memory Limit: 32 MB

Total Submission(s): 38   Accepted Submission(s): 29
Problem Description

Biving always forget things. One day, she read a book and wants to count the times of each letter appears.
Give you the content of the book, help Biving to accomplish the counting task.

Input

The input contains multiple test cases (<= 200). In each case, the first line contains an integer N (1<=N<=20) which means the book has N sentence. Then comes N lines, each line contains a string represent for the sentence. The sentence consists of only lower-case letters and the length don’t exceed 50.

Output

For each test case, output “Case #c:” first, then output the letter (in alphabet order) and times of its appearance. Just output the letters whose appearance time is larger than 0.

Sample Input
2
iloveyou
iloveyoutoo
3
aaaaaa
bbbddd
cccc
Sample Output
Case #1:
e 2
i 2
l 2
o 6
t 1
u 2
v 2
y 2
Case #2:
a 6
b 3
c 4
d 3
Source

2013绍兴市赛