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



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

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

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.strip.to!( int );
	
	return tuple( n );
}

auto solve( in int n )
{
	if( n == 0 ) return "0";
	
	auto b = "";
	int r = n;
	while( r != 0 )
	{
		b = ( r % -2 ).abs.to!string ~ b;
		r = cast( int ) ceil( cast( real ) r / -2 );
	}
	
	return b;
}
