program GREY; {$APPTYPE CONSOLE} uses SysUtils; var i,o,k:integer; n:int64; A,B:array [0..70] of byte; vh,v :text; begin { TODO -oUser -cConsole Main : Insert code here } assign (vh,'GREY.dat'); assign (v, 'GREY.sol'); reset (vh); read (vh,n); close (vh); rewrite (v); if n=0 then write (v,0) else if n=1 then write (v,1) else begin while n>=2 do begin inc (A[0]); A[A[0]]:=n mod 2; n:=n div 2; end; inc(A[0]); A[A[0]]:=1; B[0]:=A[0]; for i:=1 to B[0] do B[i]:=A[A[0]-i+1]; for i:=A[0] downto 2 do begin if B[i]<>B[i-1] then A[i]:=1 else A[i]:=0; end; A[1]:=1; end; for i:=1 to B[0] do write (v,A[i]); close (v); end.