Limits 1s, 512 MB

Bear Limak is very much fond of chocolate. His mom wants her son to study hard and develop his skills. So she decided to give some tasks to her son. She offers Limak that if he can solve those tasks, then she will give him a chocolate as a reward. The task is, she will give him a string SS. Limak has to find out which character appeared how many times in the given string.

Limak was just impressed by the offer. But all of his joy came to an end when he heard that there will be some special characters like @ # % ^… “ and spaces “ “*. His mom knew that counting the characters is an easy task, but she wanted to make it a bit difficult job for Limak. So she asks Limak not to count the special characters and spaces. But counting the character is not an easy task at all, especially when it is during the final exam time. You are the best friend of Bear Limak. Being so much busy with study Limak asks you to solve the task for him and he promised that he will share half of the chocolates with you. Are you smart enough to help your best friend?

Input

First line will contain an integer TT (0<T100 < T \le 10) denoting the number of test cases. Each test case will contain two lines. First line will contain NN (1N10001 \le N \le 1000), the length of string SS. Second line will contain string SS. SS will contain lowercase English letters, special characters and spaces only.

Output

For each test case print the test case number and the characters of SS in lexicographical order with their occurrences in string SS. If there is no valid character to count then print -1. Don’t forget to print a blank line after each test case.

Sample

InputOutput
1
5
abcde
Case 1:
a - 1
b - 1
c - 1
d - 1
e - 1


Submit

Login to submit.

Statistics

78% Solution Ratio
BruteforcekidEarliest, Jul '17
TIGERFtFastest, 0.0s
Antor_SarkerLightest, 0 B
white_monsterShortest, 172B
Toph uses cookies. By continuing you agree to our Cookie Policy.