You need to find a value of such that:
The first line of the input contains the integer (1 \le k \le 50), which represents the number of test cases. Each of the following lines describes a test case with two integers: and (0 \le a \le 10^9, 1 \le m \le 10^9).
For each test case, output the integer if it exists, or print IMPOSSIBLE if no such can be found.
Example 1