eolymp
bolt
Try our new interface for solving problems
Problems

Permutations

Permutations

Time limit 1 second
Memory limit 64 MiB

Given a string consisting of M (2M8) 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