English-Latin Dictionary
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.
Input
The first line contains a single integer N - the number of English words in the dictionary. Then, N descriptions follow. Each description is on a separate line, starting with an English word, followed by a space, a hyphen (character number 45), and then the translations of this English word into Latin, separated by commas and spaces. The translations are sorted in lexicographical order. The English words in the dictionary are also in lexicographical order.
All words consist only of lowercase Latin letters, with each word not exceeding 15 characters in length. The total number of words does not exceed 100000.
Output
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.