import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import Data.List ((\\))

main :: IO ()
main = do
  (a : _) <- map unsafeSignedDecimal . T.words <$> T.getLine :: IO [Int]
  (b : _) <- map unsafeSignedDecimal . T.words <$> T.getLine :: IO [Int]
  print . head . (\\ [a, b]) $ [1, 2, 3]

unsafeSignedDecimal :: T.Text -> Int
unsafeSignedDecimal s = case T.signed T.decimal s of
  Right (n, _) -> n
