Pero likes riddles. The newest riddle he has met asks whether a given word is a multigram.
A multigram is a word built by concatenating two or more words that are anagrams of one another. The first of those words is the root of the multigram. For example, bbabab is the concatenation of bba and bab, which are anagrams, so bbabab is a multigram with root bba.
Decide whether the given word is a multigram, and if it is, find its root. If several words can be the root, print the shortest one.
Two words are anagrams of each other when one can be obtained from the other by reordering its letters.