main :: IO ()
main = do
  _ <- (read :: String -> Int) <$> getLine
  as <- map (read :: String -> Int) . words <$> getLine
  let min_a = minimum as
      max_a = maximum as
      sum_a = sum as
  putStrLn (show min_a ++ " " ++ show max_a ++ " " ++ show sum_a)

