#include <iostream>
#include <fstream>
using namespace std;
int main()
{
	long long int n,a,bc,r;
	string s;
	ifstream fi("DE002.inp");
	ofstream fo("DE002.out");
	fi>>a;
	while((not(a==-1)))
		{	
			bc=a;
			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;
		}
	fi.close();
	fo.close();
}
