module Main where

    import Data.List
    
    import Control.Monad
    
    solve :: [Int] -> String
    solve l = show (minimum l) ++ " " ++ show (maximum l) ++ " " ++ show (sum l)
    
    readLine:: IO [Int]
    readLine = fmap (map read . words) getLine
    
    readLines :: Int -> IO [[Int]]
    readLines = flip replicateM readLine
        
    main :: IO() 
    main = do
        [n] <- readLine
        l <- readLine
        let ans = solve l
        putStrLn ans
    
