Program to find all permutations of a string