import Control.Applicative

main :: IO ()
main = do
    _ <- getLine
    input <- getLine
    let nums = map read . words $ input :: [Int]
    putStrLn . unwords . map show $ [minimum, maximum, sum] <*> [nums]