Implement algorithm for printing all combinations of a string.