#include<iostream>
using namespace std;
int shu[100];
int main()
{
long n,a,i,j,jishu,temp;
cin>>n;
while(n--)
{
cin>>a;
jishu=0;
i=0;
while(a!=0)
{
temp=a%2;
a/=2;
if(temp==1)
{
shu[i]=jishu;
i++;
}
jishu++;
}
for(j=0;j<i;j++)
{
cout<<shu[j];
if(i-1-j)
cout<<" ";
}
cout<<endl;
}
return 0;
}