module Main (main) where

import Control.Applicative

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

main :: IO ()
main = do
  _ <- getLine
  a <- map read . words <$> getLine
  putStrLn $ unwords $ map show $ solve a