eolymp
bolt
Try our new interface for solving problems
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.
Time limit 1 second
Memory limit 64 MiB
Input example #1
AB
Output example #1
AB
BA