program grey; {$APPTYPE CONSOLE} function BinToGray(b:int64):int64; begin BinToGray:=b xor (b shr 1) end; var b:int64; f:text; a:array[0..100]of byte; i:integer; begin assign(f,'grey.dat'); reset(f); read(f,b); close(f); b:=BinToGray(b); a[0]:=1; while b<>0 do begin if b mod 2 =0 then a[a[0]]:=0 else a[a[0]]:=1; a[0]:=a[0]+1; b:=b div 2; end; assign(f,'grey.sol'); rewrite(f); for i:=a[0]-1 downto 1 do write(f,a[i]); close(f); end.