A publisher has composed a bilingual dictionary English/Dutch. Every English word can have multiple Dutch translations, but the same word in Dutch could of course also be the translation of multiple English words. Now, the publisher wants to compose a bilingual dictionary Dutch/English. In order to cut costs, they hire you to write a computer program that can automatically convert the bilingual dictionary English/Dutch to a Dutch/English one.

Assignment

Write a function reverseTranslation to which a dictionary can be given that represents a bilingual dictionary. As an example, we use a dictionary English/Dutch. The keys of this dictionary are formed by the English words. The value that corresponds with a key is the list of possible translations in Dutch, represented as a list of strings.

As a result, the function must print a new dictionary, that also represents a bilingual dictionary and has the same format as the dictionary that was given to the function. Only, the words that printed as keys in this dictionary, are formed by the Dutch words that were given in the original dictionary. The value on which the Dutch words from this dictionary is portrayed, is formed by the list of English words of which the Dutch word is a possible translation. The words in this list must be in alphabetical order.

Example

>>> reverseTranslation({'tension': ['spanning'], 'voltage': ['spanning', 'voltage']})
{'spanning': ['tension', 'voltage'], 'voltage': ['voltage']}

>>> reverseTranslation({'soul': ['geest', 'gemoed', 'ziel'], 'spirit': ['geest']})
{'ziel': ['soul'], 'geest': ['soul', 'spirit'], 'gemoed': ['soul']}

>>> reverseTranslation({'wire': ['draad', 'metaaldraad'], 'thread': ['draad', 'garen']})
{'draad': ['thread', 'wire'], 'garen': ['thread'], 'metaaldraad': ['wire']}