While sorting through old books in the attic, a schoolboy named Vasya discovered an English-Latin dictionary. By then, he was fluent in English and aspired to learn Latin, so this dictionary was exactly what he needed.
However, to fully master a language, one dictionary isn't sufficient; a Latin-English dictionary is also required. Lacking a better option, Vasya decided to create the second dictionary from the first.
As we know, a dictionary consists of words to be translated, each followed by several translation words. For each Latin word appearing anywhere in the dictionary, Vasya plans to find all its translations (i.e., all the English words for which this Latin word appeared in their list of translations) and consider only these as translations of the Latin word.
Help Vasya create a Latin-English dictionary from the English-Latin one.
Each description is contained on a separate line, which first contains the English word, followed by a hyphen separated by spaces (symbol number ), then the comma-separated translations of this English word into Latin. The translations are sorted in lexicographic order. The order of English words in the dictionary is also lexicographic.
All words consist only of lowercase Latin letters, with each word not exceeding characters in length. The total number of words does not exceed .
Print the corresponding Latin-English dictionary, strictly following the input data format. Specifically, the translation of the lexicographically smallest Latin word should appear first, followed by the next in this order, and so on. Within each translation, English words should also be sorted lexicographically.
Example 1