An anagram of the word x is the word formed by the characters of the word x with each letter being used only those many times as in word x. For example, post, opst, tops are some anagrams of the word 'stop'.
Input to the program will be the word (less than 8 char.s) terminated by EOLN.
Output of the program should be the list of all anagrams of the input word; alphabetically sorted with one word per line. The upper case letters are lower than the lower case letters. Terminate the last word also with eoln.
Sample Input
tea
Sample Output
aet
ate
eat
eta
tae
tea
Tags: