Competitions

# ADA University - February 9

# Permutation (2)

Given a string consisting of **m** (**2** ≤ **m** ≤ **8**) 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.

Input example #1

AB

Output example #1

AB BA