#include<iostream>
#include<stack>
using namespace std;
int n;
int main()
{
stack<int>s;
cin>>n;
while(n--)
{
int x;
cin>>x;
while(x!=0)
{
s.push(x%2);
x=x/2;
}
while(!s.empty())
{
cout<<s.top();
s.pop();
}
puts("");
}
return 0;
}