Binary Fun#12272

Binary Fun

1 second
256 megabytes
Medium

You're given an integer and integer . You may take integers a_1, a_2, \dots, a_m from the set of -special integers in order to make the following equality hold:

a_1 \oplus a_2 \oplus a_3 \oplus \dots \oplus a_m = n

We call an integer -special if it can be represented as consecutive bits and the others are .

Report the minimum number of -special integers to XOR to obtain , or report it's impossible ().

Also output a_1, a_2, \dots, a_m — the numbers that need to be XORed.

Input

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

The only line of each test case contains two integers (1 \le n \le 10^{18} and 1 \le k \le 60) – the desired integer, and the definition parameter.

Output

For each test case, if such a_1, a_2, \dots, a_m exist:

  • The first line contains minimal .

  • The second line contains separated integers a_1, a_2, \dots, a_m in sorted manner.

Otherwise, output .

Examples

Example 1

Loading
Loading

Note

In the first test, it can be shown that the optimal solution is: 3 \oplus 12 = 15

  • 3 = (\textbf{11})_2 is a -special integer.

  • 12 = (\textbf{1100})_2 is a -special integer.

\begin{matrix} 00\textbf{11} \\ \oplus \\ \textbf{11}00 \\ \hline \textbf{1111} \end{matrix}

which stands for 1 + 2 + 2^2 + 2^3 = 15.

In the second test, it can be shown that this is the optimal construction:

  • 7 = (\textbf{111})_2 is a -special integer.

  • 56 = (\textbf{111000})_2 is a -special integer.

\begin{matrix} 000\textbf{111} \\ \oplus \\ \textbf{111}000 \\ \hline \textbf{111111} \end{matrix}

which stands for 1 + 2 + 2^2 + 2^3 + 2^4 + 2^5 = 63.

Scoring

  1. Subtask ( points): 1 \le n < 2^{20}; 1 \le k \le 20; 1 \le t \le 100

  2. Subtask ( points): k = 1

  3. Subtask ( points): No additional constraints