#include <iostream>
using namespace std;

int main() {
	int d;
	cin >> d;
	for (int j = 0; j < d; ++j){
		int n;
		bool w = false;
		cin >> n;
		for (int i = 0; n>0; ++i){
			if (n % 2 == 1){
                            if(w) cout << " ";
							w = true;
                            cout << i;
                        }
			n /= 2;
		}
		cout << endl;
	}
	return 0;
}