import Control.Applicative
import Data.List

main = do
{
    n <- getLine;
    a <- map (read::String->Int) . words <$> getLine;
    putStrLn $ (show (minimum a)) ++ " " ++ (show (maximum a)) ++ " " ++ (show (sum a))
}