import Control.Applicative
import Control.Monad
import Text.Printf

answer :: [Int] -> IO ()
answer list = printf "%d %d %d" (minimum list) (maximum list) (sum list)

main = do
    _ <- getLine
    nums <- (map read) . words <$> getLine
    answer nums
    putStrLn ""

