As a studious French officer, Pierre-François Bouchard is interested in ancient languages. In a recent expedition, he uncovered a clay tablet with what appeared to be inscriptions in a long-forgotten language. Having made a copy of all the words on the tablet, Pierre-François would like to create a dictionary for future scholars. He's transcribed words from the tablet, and has contacted you in the hopes that you'll be able to sort them for him.
Each word is formed only from lowercase Latin characters no longer than characters in length. You are to organize the words into alphabetical sections by the first letter, with individual sections sorted in lexicographically increasing order.
Remember:
A string is said to be lexicographically smaller than a string if and is a prefix of or and . Here, denotes the length of the string.
Input Specification
The first line of input will contain the number .
The following lines each contain a word.
Output Specification
For each non-empty section, output a line containing all words in lexicographical order separated by ,
(a comma and space).
Sample Input
5
eggnog
cake
biscuits
chocolate
tea
Sample Output
biscuits
cake, chocolate
eggnog
tea
Comments