import Data.List

solve :: [Int] -> [Int]
solve xs = [minimum xs , maximum xs , sum xs]

main :: IO ()
main  = getLine
    >> getLine
    >>= return . map read . words
    >>= return . solve
    >>= return . intersperse " " . map show
    >>= mapM_ putStr
    >> putStrLn ""