Alice's Power-of-Two Candy Boxes
Alice runs a tiny candy shop with a peculiar stock: she has exactly one sealed box of each size 1, 2, 4, 8, 16, ... candies, one box for every power of two. Boxes can't be opened, so whenever Bob asks for exactly n candies, Alice must hand him a set of whole boxes whose sizes add up to exactly n, using each box at most once. Alice has noticed that this is always possible, and that there is always exactly one way to do it.
Bob places q orders. For each order, tell Alice how many boxes she gives him and which ones.
Input
The first line contains an integer q (1 ≤ q ≤ 10^4), the number of orders.
Each of the next q lines contains one integer n (1 ≤ n ≤ 10^18), the number of candies Bob asks for.
Output
For each order print one line: first the number of boxes k, then the k box sizes in ascending order, all separated by single spaces.
Notes
In the first example, 1 is a single box, 6 = 2 + 4, 7 = 1 + 2 + 4 uses three boxes, 8 is again a single box, and 13 = 1 + 4 + 8.
In the second example, 10^18 needs boxes up to 2^59 = 576460752303423488, far beyond 32 bits, so use a 64-bit integer type (long long in C and C++, int64 in Go). The order 576460752303423487 = 2^59 − 1 needs every box from 1 up to 2^58: 59 boxes in all.