H. Hunting Down Binary Numbers
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Given positive integers $$$l$$$ and $$$x$$$, help SnowballSH find two integers $$$a$$$ and $$$b$$$ such that:

  • $$$l \le a \le b \le 10^{18}$$$, and
  • $$$\mathrm{popcount}(a \oplus b) = x$$$.$$$^{\text{∗}}$$$$$$^{\text{†}}$$$

$$$^{\text{∗}}$$$The bitwise XOR of non-negative integers $$$x$$$, $$$y$$$, $$$x \oplus y$$$, is defined as follows:

When $$$x \oplus y$$$ is written in binary, the digit in the $$$2^k$$$ ($$$k \ge 0$$$) place is $$$1$$$ if exactly one of $$$x,y$$$ has $$$1$$$ in the $$$2^k$$$ place when written in binary, and $$$0$$$ otherwise.

For example, $$$3 \oplus 5 = 6$$$ (in binary representation: $$$011 \oplus 101=110$$$).

$$$^{\text{†}}$$$$$$\mathrm{popcount}(x)$$$ represents the number of $$$1$$$s in the binary representation of $$$x$$$.

For example, $$$13=1101_{(2)}$$$, so $$$\mathrm{popcount}(13)=3$$$.

Input

The first line contains a single integer $$$t$$$ $$$(1 \le t \le 10^4)$$$ — the number of test cases.

The only line of each test case contains two integers $$$l$$$ and $$$x$$$ $$$(1 \le l \le 10^{17}, 1 \le x \le 59)$$$.

Output

Output two integers $$$a$$$ and $$$b$$$ such that $$$l \le a \le b \le 10^{18}$$$ and $$$\mathrm{popcount}(a \oplus b) = x$$$.

If there are multiple answers, you may output any of them.

It can be shown that an answer always exists.

Example
Input
3
1 1
2 2
15 3
Output
6 7
2 22
20 25
Note

For the first test case, we have $$$l=1$$$ and $$$x=1$$$. $$$a=6$$$ and $$$b=7$$$ works, because $$$1 \le 6 \le 7 \le 10^{18}$$$ and $$$\mathrm{popcount}(6 \oplus 7) = \mathrm{popcount}(1) = 1$$$.

For the second test case, we have $$$l=2$$$ and $$$x=2$$$. $$$a=2$$$ and $$$b=22$$$ works, because $$$1 \le 2 \le 22 \le 10^{18}$$$ and $$$\mathrm{popcount}(2 \oplus 22) = \mathrm{popcount}(20) = \mathrm{popcount}(10100_{(2)}) = 2$$$.

For the third test case, we have $$$l=15$$$ and $$$x=3$$$. $$$a=20$$$ and $$$b=25$$$ works, because $$$15 \le 20 \le 25 \le 10^{18}$$$ and $$$\mathrm{popcount}(20 \oplus 25) = \mathrm{popcount}(13) = \mathrm{popcount}(1101_{(2)}) = 3$$$.