All Permutations
Print every distinct permutation of the string in lexicographic (dictionary) order.
Input
One lowercase word.
Output
One permutation per line.
Constraints
1 to 7 letters.
Sample 1
Input
abc
Output
abc acb bac bca cab cba
Sample 2
Input
aab
Output
aab aba baa