import Control.Applicative
import qualified Data.Traversable as Traversable

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