
#include <bits/stdc++.h>

using namespace std;

ifstream fi ("dayso.inp");
ofstream fo ("DOINP.OUT");

void doinp(int a)
{
    int b[1000000],i=0;
    while (a>0){
        b[i]=a%2;
        a=a/2;
        i++;
    }
    for (int k=i-1;k>=0;k--){fo<<b[k];}
    fo<<endl;
    return;
}

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;
}
