Problems
Permutations
Permutations
Given a string consisting of \textbf{M} (\textbf{2} ≤ \textbf{M} ≤ \textbf{8}) of distinct characters (letters and numbers). Need to bring all permutations of this string of characters in alphabetical order.
\InputFile
In the first line of the file is the source string.
\OutputFile
Output in each line of the file for one permutation.
Input example #1
AB
Output example #1
AB BA