n = io.read("*n")
dig = 1
flg = 1
if(0 < n) then flg = 0 end
t = {}
while(0 < n) do
  rem = n % 2
  if(dig % 2 == flg and rem == 1) then
    n = n + 1
  end
  table.insert(t, 1, rem)
  n = math.floor(n / 2)
  flg = (flg + 1) % 2
end
len = #t
for i = 1, len do
  io.write(string.format("%d", t[i]))
end
if(len == 0) then io.write(0) end
io.write("\n")
