The first line contains an integer(
), denoting the number of test cases.
The only line of each test case contains two integers(
), denoting a fraction
. It's guaranteed that
.
For each test case, output one line: first an integerdenoting the height of the continued fraction, then
integers denoting
. Your solution should gurarantee that
,
.
If there are multiple valid solutions, you only need to output one of them.