Word Mutations - 2 Points
Hey there super-spy! You have just been selected for a very secret intelligence
mission. We've been obtaining character sequences being sent across a satelite
of ours from the devious Ms. Nev R. Gudenuf. Unfortunately, the messages
are just garbled combinations of letters, and we can't tell exactly what
we're looking at. Your task is to take the given sequence(s) in and produce
all possible combinations of those letters, which our crack linquistic team
will then use to try to decipher the message.
Input Format
First, you will be given a number (n) representing the number of sequences
to follow.
Then, on each of the n-following lines will be garbled character sequences.
(Letters may be repeated and each should be treated as a separate letter.)
The input file will be called jin06.txt.
Output Format
You should output all combinations of the letters of each given sequence.
Do not separate each permutation by a blank line.
Do, however, separate each new set of letters by a blank line.
Note: Your ordering may be different than the output shown, but
should have the same number of permutations.
Example
Input
1
abc
Output
abc
acb
bac
bca
cab
cba