unittest
{
	assert( [ "-9" ].solve == "1011" );
	assert( [ "123456789" ].solve == "11000101011001101110100010101" );
	assert( [ "0" ].solve == "0" );
}



import std.conv;
import std.math;
import std.range;
import std.stdio;

void main()
{
	stdin.byLineCopy.solve.writeln;
}

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	
	if( n == 0 ) return "0";
	
	auto anss = "";
	while( n != 0 )
	{
		anss ~= abs( n % -2 ).to!( string );
		n = cast( long ) ceil( n / -2.0L );
	}
	return anss.retro.to!( string );
}
