#P1810B. Candies
Candies
Description
This problem is about candy. Initially, you only have candy, and you want to have exactly candies.
You can use the two following spells in any order at most times in total.
- Assume you have candies now. If you use the first spell, then candies become candies.
- Assume you have candies now. If you use the second spell, then candies become candies.
Construct a sequence of spells, such that after using them in order, you will have exactly candies, or determine it's impossible.
Each test contains multiple test cases. The first line contains a single integer () — the number of test cases. Their description follows.
Each test case contains one line with a single integer () — the required final number of candies.
For each test case, output the following.
If it's possible to eventually have candies within spells, in the first line print an integer (), representing the total number of spells you use.
In the second print integers ( is or ) separated by spaces, where means that you use the first spell in the -th step, while means that you use the second spell in the -th step.
Note that you do not have to minimize , and if there are multiple solutions, you may output any one of them.
If it's impossible, output in one line.
Input
Each test contains multiple test cases. The first line contains a single integer () — the number of test cases. Their description follows.
Each test case contains one line with a single integer () — the required final number of candies.
Output
For each test case, output the following.
If it's possible to eventually have candies within spells, in the first line print an integer (), representing the total number of spells you use.
In the second print integers ( is or ) separated by spaces, where means that you use the first spell in the -th step, while means that you use the second spell in the -th step.
Note that you do not have to minimize , and if there are multiple solutions, you may output any one of them.
If it's impossible, output in one line.
Note
For , you can just use the second spell once, and then have candies.
For , you can use the second spell twice. After the first step, you will have candies. And after the second step, you will have candies.