463. String Permutation

0

Medium

Kartik and Parth are both fascinated by strings. They have come up with a game where Parth gives Kartik a string and asks him to generate all possible strings in lexicographical order, starting with the smallest string. However, there is a condition that must be satisfied during the permutation process: Kartik can change each letter individually to either lowercase or uppercase, but the order of the characters in the string must remain the same.

Input Format

The input consists of a single line containing a string.

Output Format

Print all possible permutations of strings that satisfy the given condition.

Example

Input

3z4

Output

3z4 3Z4

Constraints

1 <= s.length <= 12
Loading...

View Submissions

Console