#P1810B. Candies

    ID: 83 Type: RemoteJudge 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: 3 Uploaded By: Tags>constructive algorithmsmathnumber theory*800

Candies

Description

This problem is about candy. Initially, you only have 11 candy, and you want to have exactly nn candies.

You can use the two following spells in any order at most 4040 times in total.

  • Assume you have xx candies now. If you use the first spell, then xx candies become 2x12x-1 candies.
  • Assume you have xx candies now. If you use the second spell, then xx candies become 2x+12x+1 candies.

Construct a sequence of spells, such that after using them in order, you will have exactly nn candies, or determine it's impossible.

Each test contains multiple test cases. The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases. Their description follows.

Each test case contains one line with a single integer nn (2n1092 \le n \le 10^9) — the required final number of candies.

For each test case, output the following.

If it's possible to eventually have nn candies within 4040 spells, in the first line print an integer mm (1m401 \le m \le 40), representing the total number of spells you use.

In the second print mm integers a1,a2,,ama_{1}, a_{2}, \ldots, a_{m} (aia_{i} is 11 or 22) separated by spaces, where ai=1a_{i} = 1 means that you use the first spell in the ii-th step, while ai=2a_{i} = 2 means that you use the second spell in the ii-th step.

Note that you do not have to minimize mm, and if there are multiple solutions, you may output any one of them.

If it's impossible, output 1-1 in one line.

Input

Each test contains multiple test cases. The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases. Their description follows.

Each test case contains one line with a single integer nn (2n1092 \le n \le 10^9) — the required final number of candies.

Output

For each test case, output the following.

If it's possible to eventually have nn candies within 4040 spells, in the first line print an integer mm (1m401 \le m \le 40), representing the total number of spells you use.

In the second print mm integers a1,a2,,ama_{1}, a_{2}, \ldots, a_{m} (aia_{i} is 11 or 22) separated by spaces, where ai=1a_{i} = 1 means that you use the first spell in the ii-th step, while ai=2a_{i} = 2 means that you use the second spell in the ii-th step.

Note that you do not have to minimize mm, and if there are multiple solutions, you may output any one of them.

If it's impossible, output 1-1 in one line.

Sample Input 1

4
2
3
7
17

Sample Output 1

-1
1
2 
2
2 2 
4
2 1 1 1

Note

For n=3n=3, you can just use the second spell once, and then have 21+1=32 \cdot 1 + 1 = 3 candies.

For n=7n=7, you can use the second spell twice. After the first step, you will have 33 candies. And after the second step, you will have 23+1=72 \cdot 3 + 1 = 7 candies.