#include<bits/stdc++.h>
using namespace std;
long int n,a[10000],i,b[10000],j;
ifstream fi("dayso.inp");
ofstream fo("doinp.out");
void decToBinary(int n)
{
    for (int i = 31; i >= 0; i--) {
        int k = n >>s i;
        if (k & 1)
            fo << "1";
        else
            fo << "0";
    }
    return;
}
int main()
{
fi>>n;
for(j=0;j<n;j++)
{fi>>b[j];
decToBinary(b[j]);
fo<<endl;}
return 0;
}
