#include <iostream>
#include <fstream>
#include <cmath>
#include <iomanip>

using namespace std;
ifstream fi("doinp.inp");
ofstream fo("doinp.out");
int n,a[100000];

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

doinp()
{
    doc();
    for (int i = 0; i < n; i++)
    {
       if (a[i] > 0)
       {
          int d = 0,s[n];
          int tg = a[i];
          while (tg > 0)
          {
             s[d] = tg%2;
             tg /= 2;
             d++;
          }
          for (int j = d-1; j >= 0; j--) fo << s[j];
          fo << endl;
       }
    }
    return 0;
}

main ()
{
    doinp();
	return 0;
}
