Bob has a string password S of length N consists only of digits 0, 1, and 2. The password needs to follow the given requirements:
Bob wants to replace the minimum number of characters in the password S so that it meets the given requirements.
Help Bob find the minimum number of replacements and print the corresponding possible variant of the password. If there are multiple passwords possible, print the lexicographically smallest.
Input format
Output format
For each test case, print the minimum replacements required in a new line. In the next line, print the updated lexicographically smallest password S.
Constraints
1≤T≤1000001≤N≤2000000≤A,B≤N (A+B≤N)
Sum of N over T testcases does not exceed 1e6
For the first testcase, the minimum number of replacements required is 2. Some of the possible variants of password are "011122", "012112" and "111022". But the lexicographically smallest password is "011122".
For the second testcase, we need to do 4 replacements. The only possible variant of the password is "00000".