printing all permutations of the given string