#include <bits/stdc++.h>
using namespace std;
string doinp(int x)
{
    string s;
    s="";
    int r;
    while(x!=0)
    {
        r=x%2;
        x=x/2;
        if(r==1){s='1'+s;}
        if(r==0){s='0'+s;}
    }
    return s;
}
int main()
{
    ifstream f1("dayso.inp");
    ofstream f2("doinp.out");
    int n;
    f1>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
        f1>>a[i];
    }
    for(int i=0;i<n;i++)
    {
        f2<<doinp(a[i])<<endl;
    }
}
