toInt :: (String -> Int)
toInt x = read x ::Int
max' [] = error "empty"        -- 1番目
max' [x] = x                   -- 2番目
max' (x:xs) = max x (max' xs)

main = do
  args <- words <$> getLine
  let argsInt = map(toInt) args
  let addResult = sum argsInt
  let distResult =  toInt (args !! 0) - toInt(args !! 1)
  let prodResult = product argsInt
  print (max' [addResult, distResult, prodResult])
