program grey; {$APPTYPE CONSOLE} var a,b:array[0..100] of integer; j,k,i,n:integer; begin assign(input,'grey.DAT'); reset(input); assign(output,'grey.SOL'); rewrite(output); readln(n); i:=0;k:=0; while(n<>0)do begin a[i]:=n mod 2; n:=n div 2; i:=i+1; end; b[0]:=a[99]; for i:=99 downto 0 do begin if(a[i]=0)and (a[i-1]=0) then b[k]:=0; if(a[i]=1)and (a[i-1]=1) then b[k]:=0; if(a[i]=0)and (a[i-1]=1) then b[k]:=1; if(a[i]=1)and (a[i-1]=0) then b[k]:=1; k:=k+1; end; j:=0; while (b[j]=0) do j:=j+1; for i:=j to 99 do write( b[i]); writeln; close(input); close(output); end.