24. Lexicographic permutations