problem 24: Lexicographic permutations