
local n = tonumber(io.read());
local result = "";
n = -n;

repeat
    if n & 1 == 0 then
        result = "0" .. result;
    else
        result = "1" .. result;
    end
    n = n // -2;
until n == 0

print(result)
