favorite We need a little bit of your help to keep things running, click on this banner to learn more
Competitions

# Permutation (2)

Given a string consisting of m (2m8) characters (Latin letters and digits). Print all permutations of symbols for this string.

#### Input

One string of symbols.

#### Output

Print all permutations for the given string in lexicographical order. Each permutation must be printed on a separate line.

Time limit 1 second
Memory limit 64 MiB
Input example #1
AB

Output example #1
AB
BA