http://acm.hdu.edu.cn/showproblem.php?pid=1390
/*
2011-9-15
author:BearFly1990
*/
package acm.hdu.tests;
import java.io.BufferedInputStream;
import java.util.Scanner;
public class HDU_1390 {
public static void main(String[] args) {
Scanner in = new Scanner(new BufferedInputStream(System.in));
int t = in.nextInt();
while(t-- > 0){
int n = in.nextInt();
String str = Integer.toBinaryString(n);
int[] arry = new int[str.length()];
int index = 0;
//System.out.println(str);
for(int i = 0 ,j = str.length()-1; j >= 0 ; i++,j--){
if(str.charAt(j) == '1'){
arry[index++] = i;
}
}
System.out.print(arry[0]);
for(int i = 1 ; i < index; i++){
System.out.print(" "+arry[i]);
}
System.out.println();
}
}
}