Hide

Problem N
Bitwise Independent Divisors

Given an integer $n$, find the largest subset of its divisors such that for any two distinct elements $x$, $y$ in the subset, $x \& y = 0$, where $\& $ represents the bitwise AND operation.

Input

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

Each test case consists of a single line with an integer $n$ ($1 \le n \le 10^9$), as described above.

Output

The first line of output for each test case should contain a single integer $k$ —the maximum size of such a subset of divisors of $n$.

The second line of output for each test case should contain $k$ distinct divisors of $n$ —one subset of size $k$ satisfying the necessary constraints.

If there are multiple solutions, print any.

Sample Input 1 Sample Output 1
6
1
10
11
36
54
35360
1
1
2
2 5
1
11
3
1 12 18
2
6 9
6
2 65 136 260 544 1040

Please log in to submit a solution to this problem

Log in