Problem: You are given a positive integer . Find the longest sequence of positive integers that satisfies the following conditions, and print the sequence:
- for all .
- is strictly increasing. That is, for all .
- for all , where denotes the bitwise OR operation.
Input Format: Each test contains multiple test cases. The first line contains the number of test cases (). Description of the test cases follows.
The only line of each test case contains one integer ().
It's guaranteed that the sum of lengths of the longest valid sequences does not exceed .
Output Format: For each testcase, print two lines. In the first line, print the length of your constructed sequence, . In the second line, print positive integers, denoting the sequence. If there are multiple longest sequences, you can print any of them.