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