//这道题挺简单的
//题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=383
#include<iostream> using namespace std; int a[10000]; int main() { int i, k, m, n; int t; cin >> t; while (t--) { cin >> m; n = m; k = 0; while (n > 0) { a[k] = n % 2; n = n / 2; k++; } k--; for (i = 0; i < k; i++) { if (a[i])cout << i<<" "; } cout << k << endl; } return 0; }