import Data.Functor( (<$>))


main = do
    getLine
    as <- (read <$>) . words <$> getLine
    let
	resultStr = (show $ minimum as)++" "++
		    (show $ maximum as)++" "++
		    (show $ sum as)

    putStrLn resultStr

