import Data.Vector hiding (map)

main = do
  [a,b] <- map read.words <$> getLine :: IO [Integer]
  print $ solve a b

solve a b = bi 0 $ inner 0
  where
  inner 40 = []
  inner 0
    | even d = (a + d`div`2`mod`2) `mod` 2 : inner 1
    | otherwise = (d`div`2`mod`2+1)`mod` 2 : inner 1
    where
    d = b - a
  inner k = (be + en) `mod` 2 : inner (k+1)
    where
    be = min (pow2 (k+1) - a `mod` pow2 (k+1)) (pow2 k)
    en = max (b `mod` pow2 (k+1) - pow2 k + 1) 0

bi _ [] = 0
bi k (x:xs) = x * pow2 k + bi (k+1) xs

pow2 = unsafeIndex ( fromListN 42 $ iterate (*2) 1 )

infixl 4 -|
a -| b
  | a-b < 0 = 0
  | otherwise = a-b