class a {
public static void main ( String args[] ) {
char[] combos = new char[args[0].length()];
findCombos ( args[0], new String(combos), 0 );
}
private static void findCombos( String str, String combos, int index ) {
char[] comboChars = combos.toCharArray();
if ( index == str.length()) {
System.out.println( new String(comboChars) );
return;
}
for ( int i = 0; i < str.length(); i++ ) {
char[] strChars = str.toCharArray();
comboChars[index] = strChars[i];
index++;
findCombos(str, new String(comboChars), index);
index--;
}
}
}