Permutation generator.