import std.stdio, std.conv, std.string;
import std.algorithm, std.array, std.container;
import std.numeric, std.math;
import core.bitop;

string my_readln() { return chomp(readln()); }

long mod = pow(10, 9) + 7;
long moda(long x, long y) { return (x + y) % mod; }
long mods(long x, long y) { return ((x + mod) - (y % mod)) % mod; }
long modm(long x, long y) { return (x * y) % mod; }

void main()
{
	auto N = my_readln.to!long;

	ulong[32] d;
	foreach (i; 0..32)
	{
		auto x = N % 2;
		//stderr.writeln(N, " ", x);
		N /= 2;
		long sign;
		if (i % 2 == 0) sign = 1;
		else			sign = -1;
		if (sign * sgn(x) >= 0)
		{
			d[i] += abs(x);
		}
		else
		{
			++d[i+1];
			++d[i];
		}
		while (d[i] > 1)
		{
			++d[i+2];
			++d[i+1];
			d[i] -= 2;
		}
	}

	string ans;
	bool hasStart = false;
	foreach_reverse (e; d)
	{
		if (hasStart)
		{
			ans ~= e.to!string;
		}
		else if (e == 1)
		{
			ans ~= e.to!string;
			hasStart = true;
		}
	}
	if (!hasStart) ans ~= "0";

	writeln(ans);
	stdout.flush();
}