#include <iostream>using namespace std;int main(){int TestCase;while (cin >> TestCase){while (TestCase--){int Num, i = 0, temp, flag = 0;cin >> Num;while (1){temp = Num % 2;Num /= 2;if (temp != 0){if (flag == 0)cout << i;else{ cout << " " << i;} flag = 1;}if (Num == 0)break;i++;}cout << endl;}}}


