MOG Round #36Ended |
Given a string, your task is to generate all different strings that can be created using its characters.
Given a string, your task is to generate all different strings that can be created using its characters.
The only input line has a string of length $n$. Each character is between a–z.
**Constraints**
- $1 \le n \le 8$
The only input line has a string of length $n$. Each character is between a–z.
Constraints
First print an integer $k$: the number of strings. Then print $k$ lines: the strings in alphabetical order.
First print an integer $k$: the number of strings. Then print $k$ lines: the strings in alphabetical order.