Given several words, compute the number of appearances of each one. Print first the most common words, and use the lexicographical order to break ties.
Input consists of several cases. Every case begins with a number between 1 and , followed by words made up only of lowercase letters.
Print the counters and the words in the right order. Print a line with 10 dashes at the end of every case.
Input
6 z anna abba ivet ivet anna 3 hi hi hi
Output
2 anna 2 ivet 1 abba 1 z ---------- 3 hi ----------