output all permutations of a string