3437: Permutations III

Problem Statement