#include<iostream>
using namespace std;

int main()
{
    int total,t,n,i;
    cin>>total;
    for (t=0;t<total;t++)
    {
        cin>>n;
        for (i=31;i>-1;i--)
        cout<<((n>>i)&1);
        cout<<endl;
    }
}
