
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
Each word is formed only from lowercase Latin characters no longer than
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
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