import Control.Applicative

type Result = (Int, Int, Int)

solve :: [Int] -> Result

solve as
    = (minimum as, maximum as, sum as)

input :: IO [Int]

input
    = do
        getLine
        as <- map read.words <$> getLine
        return as

output :: Result -> IO ()

output (n, m, s)
    = putStrLn $ init $ concat [show x ++ " " | x <- [n, m, s]]
    
main :: IO ()

main = output =<< solve <$> input