import Control.Applicative
import Control.Monad

main :: IO ()

main = do
    getLine
    input <- map read . words <$> getLine
    putStrLn $ unwords . map show $ [minimum input, maximum input, sum input]
