#K85322. String Permutations

    ID: 36616 Type: Default 1000ms 256MiB

String Permutations

String Permutations

Given a string s consisting of distinct characters, generate all its permutations. A permutation is an arrangement of all the characters in the string. The total number of permutations is given by \(n!\) where \(n\) is the length of the string.

Your task is to output all the permutations in lexicographical order, with each permutation printed on a new line.

inputFormat

The input consists of a single line containing the string s composed of letters only.

outputFormat

Output all the distinct permutations of s in lexicographical order. Each permutation should be printed on a separate line.

## sample
a
a

</p>