{-# LANGUAGE OverloadedStrings #-}

import qualified Data.ByteString.Char8 as B
import Data.Attoparsec.ByteString.Char8

import Data.List (foldl1')
import Data.Bits

type Input  = (Int, Int)
type Output = Int

input :: Parser Input
input = (,)      
  <$> decimal <* char ' '
  <*> decimal <* endOfLine

main :: IO ()
main = B.interact
  $ B.pack . show . either (error "parse err") solve . parseOnly input

solve :: Input -> Output
solve (_A, _B) = foldl1' xor [_A .. _B]