eolymp
bolt
Try our new interface for solving problems
Problems

Permutation of letters

Permutation of letters

Time limit 1 second
Memory limit 128 MiB

Given a string consisting of m symbols. Print all permutations of symbols for this string.

Input data

One string consisting of m~(2 \le m \le 8) of symbols — Latin letters and digits.

Output data

Print all permutations for the given string in lexicographical order.

Examples

Input example #1
AB
Output example #1
AB
BA