Construct the Lexicographically Largest Valid Sequence