
#include <bits/stdc++.h>

using namespace std;

ifstream fi ("doinp.inp");
ofstream fo ("doinp.out");

void doinp(int a)
{
    string k="";
    while (a>0){
        if (a%2==0){k='0'+k;}
        if (a%2==1){k='1'+k;}
        a=a/2;
    }
    fo<<k<<endl;
}

int main(){
  int n;
  fi>>n;
  int a[n],i=0;
  for (i=0;i<n;i++){ fi >> a[i];}
  for (i=0;i<n;i++){
   doinp(a[i]);
  }
    return 0;
}
