Program to print all permutations of a given string