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