Task
Gary was in his math class learning about prime factorization, when his teacher gave him a problem: given two integers and , find their GCD (greatest common divisor), LCM (least common multiple), and product (). Gary quickly solves the problems, writes the three answers on three separate pieces of paper. Then the bell rings and Gary rushes to the lunch line to get as much food as he can!
However, when he comes back, one of the papers is missing! One of his classmates is punishing him for being so greedy. Furthermore, he doesn't remember which of the papers remaining is which, and he also doesn't remember the values and .
Given the two values, find all possible values for the third value for each of test cases.
Input data
The first line contains , the number of test cases. Each of the next lines contains two numbers and , representing the two numbers remaining.
Output data
For each of the test cases, the output is on the single line as follows:
The first integer represents the number of possible values for the third value (call this ), while the next values on the same line represent the different possible values for the third value in increasing order.
Note that if there is no possible value that works, output .
Constraints and clarifications
- ;
- ;
- The test cases will be graded individually.
Example
stdin
8
5 7
4 2
10 3
9 3
6 12
2 2
2 256
3 7
stdout
0
2 2 8
0
2 3 27
2 2 72
2 1 4
2 128 512
0