print all possible permutations of a array