1063: All possible strings
[Creator : ]
Description
Given a string S with N characters (N<8), please output all the possible string after re-arrange the
order of the string. For example, given S="abcc", then output:
abcc
acbc
accb
bacc
bcac
bcca
cabc
cacb
cbac
cbca
ccab
ccba
Please output in ascending order!
order of the string. For example, given S="abcc", then output:
abcc
acbc
accb
bacc
bcac
bcca
cabc
cacb
cbac
cbca
ccab
ccba
Please output in ascending order!
Input
one line with the string S
Output
all the possible strings in ascending order, one line one string!
Sample Input Copy
abcc
Sample Output Copy
abcc
acbc
accb
bacc
bcac
bcca
cabc
cacb
cbac
cbca
ccab
ccba