var i,c1,c2:integer; n,j:int64; s: array [1..70] of byte; f1,f2:text; begin assign(f1,'grey.dat'); assign(f2,'grey.sol'); reset(f1); readln(f1,n); close(f1); c1:=0; while n>0 do begin c1:=c1+1; s[c1]:=n mod 2; n:=n div 2; end; c2:=c1; s[c1+1]:=0; rewrite(f2); for i:=c1 downto 2 do begin if s[i]+s[i+1]=1 then begin write(f2,'1'); end else begin write(f2,'0'); end; end; if s[1]+s[2]=1 then begin writeln(f2,'1'); end else begin writeln(f2,'0'); end; close(f2); end.