import Control.Applicative
main = do
    _ <- getLine
    numbers <- (map read . words) <$> getLine
    putStr $ show $ minimum numbers
    putStr " "
    putStr $ show $ maximum numbers
    putStr " "
    putStr $ show $ sum numbers
    putStrLn ""