#C14318. Letter Case Permutations

    ID: 43954 Type: Default 1000ms 256MiB

Letter Case Permutations

Letter Case Permutations

Given a string (s) consisting of letters and digits, generate all possible strings by toggling the case of each alphabetic character. In other words, for every letter in (s), you may either convert it to lowercase or uppercase. The output should list all possible permutations in lexicographical order (based on ASCII values). For example, if (s = \texttt{a1b2}), the possible permutations are: ({\texttt{A1B2}, \texttt{A1b2}, \texttt{a1B2}, \texttt{a1b2}}).

inputFormat

A single line containing the string (s) composed of digits and letters.

outputFormat

Print each permutation on a new line in lexicographical order.## sample

a1b2
A1B2

A1b2 a1B2 a1b2

</p>