Statement
A ladder has vertical bars, numbered from to from left to right. Heights where horizontal rungs may be placed are numbered from to from top to bottom. Initially, there are no rungs.
To traverse the ladder, start at the top of one vertical bar and move downward. Whenever you encounter a horizontal rung connected to the current bar, follow the rung to the adjacent bar, then continue moving downward. Repeat this process until you reach the bottom of the ladder.
You may perform the following two operations:
- : Toggle the rung joining bars and at height . Create it if it is absent, or erase it if it is present.
- : Start at the top of bar and follow the ladder downward. Determine the number of the bar reached at the bottom. This operation does not change the ladder.
Two rungs at the same height may not share a bar. Therefore, this condition must still hold after a type- operation creates a rung. If , no rung can be placed and no type- operation is allowed.
You are given target pairs . Perform exactly type- operations in order so that the -th type- operation starts at bar and ends at bar . You may use at most type- operations over the entire sequence of operations.
Input
The input is given in the following format:
Each case is given in the following format:
is the number of test cases. The -th target pair is .
Output
For each test case, first print the total number of operations . Then print the operations in order, one per line. Each operation has the form or .
There must be exactly type- operations. The -th must start on bar and end on bar . There may be at most type- operations. If there are multiple solutions, print any of them.
Constraints
- .
- .
- ().
- The sum of over all test cases is at most .
Subtasks
Samples
In the first case, the first type- operation goes from bar to bar , and the second goes from bar to bar . The second case needs no rung.