import Control.Applicative
import Data.List
main = solve

solve = do
    n <- readLn :: IO Int
    ns <- fmap (read :: String -> Int) . words <$> getLine
    let min = minimum ns
        max = maximum ns
        amount = sum ns
    putStrLn $ (show min) ++ " " ++ (show max) ++ " " ++ (show amount)