var n,i:longint; a,b:array [1..1000] of byte; tr:boolean; m:int64; begin assign(input,'grey.dat');reset(input); assign(output,'grey.sol');rewrite(output); readln(m); n:=0; while m>1 do begin inc(n); a[n]:=m mod 2; m:=m div 2 end; if m<>0 then begin inc(n); a[n]:=1 end; for i:=n downto 1 do if ((a[i]=1)and(a[i+1]=0))or((a[i]=0)and(a[i+1]=1)) then b[i]:=1 else b[i]:=0; tr:=true; for i:=n downto 1 do if ((b[i]=0)and(not tr))or(b[i]<>0) then begin write(b[i]); tr:=false end; if m=0 then write(0); writeln; close(input); close(output); end.