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