import Data.Bits (xor) main = getLine >>= print . (\ac -> head ac `xor` last ac) . map (read :: String -> Int) . words