#include <iostream>
#include <fstream>
using namespace std;
int main()
{
	int n,a,bc,r;
	string s;
	ifstream fi("DOINP.inp");
	ofstream fo("DOINP.out");
	fi>>a;
	while((not(a==-1)))
	{
		bc=a;
		r=0;
		if(a<=1)
		{
			fo<<a<<endl;
		}
		else
		{
			while(bc>1)
			{
				r=bc%2;
				if(r==1)
				{
					s='1'+s;
				}
				else
				{
					s='0'+s;
				}
				bc=int(bc/2);
			}
			if(bc==1)
			{
				s='1'+s;
			}
			fo<<s<<endl;
		}
		fi>>a;
		s="";
	}
	fi.close();
	fo.close();
}
