Binary Number

Time limit1sMemory limit128 MB

Problem

You are given a positive integer $n$. Write a program that finds the positions of all bits equal to $1$ in the binary representation of $n$. Bit positions are numbered starting from the least significant bit (LSB), which is position $0$, and increase by $1$ toward the most significant bit.

Input

The first line contains the number of test cases $T$. Each of the next $T$ lines contains a single integer $n$.

  • $1 \le T \le 10$
  • $1 \le n \le 10^6$

Output

For each test case, print on one line the positions of the bits equal to $1$, in increasing order of position, separated by single spaces.