import Control.Applicative
import qualified Control.Monad as Monad

main = do
    getLine
    xs <- map (read :: String -> Int) . words <$> getLine
    putStrLn $ unwords $ show <$> Monad.sequence [minimum, maximum, sum] xs