1259 Binary Numbers


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

Given a positive integer n, print out the positions of all 1’s in its binary representation. The position of the least significant bit is 0. For example, The positions of 1’s in the binary representation of 13 are 0,2,3. Your task is writing a program which for each data set: Reads a positive integer n, Computes the positions of 1’s in the binary representation of n, and writes the result.

Input

The first line of the input contains exactly one positive integer d equal to the number of data sets, 1<=d<=1000. The data sets follow. Each data set consists of exactly one line containing exactly one integer n, 1<=n<=10^6.

Output

The output should consists of exactly d lines, one line for each data set. Line I, 1<=I<=d, should contain increasing sequence of integers seperated by single spaces –the positions of 1’s in the binary representation of the I-th input number.

Sample

Input

1
13

Output

0 2 3

Comments

There are no comments at the moment.