main=map read.words<$>getLine>>=print.(\(a:[b])->f a b)
 where f a b |(even a)&&(even b) = b+(mod(quot(b-a)2)2)
             |(even a)&&(odd b)  = mod(quot(b-a)2)2
             |(odd a)&&(even b)  = g a b (mod(quot(b-a-1)2)2)
             |(odd a)&&(odd b)   = a-(mod(quot(b-a)2)2)
       g a b i =(if(mod a 2)==(mod b 2)then(+)else(-)) (h a b 0) i
       h 0 0 _ =0
       h a b e =(mod(a+b)2)*(2^e)+(h (quot a 2) (quot b 2) (e+1))