Printing permutations of a given string