import Control.Applicative
import Control.Monad
import Data.List
import qualified Data.Map as M
import Text.Printf

readInts :: IO [Int]
readInts = map read . words <$> getLine

main :: IO ()
main = do
  getLine
  xs <- readInts
  let (m0, m1, s) = solve xs
  printf "%d %d %d\n" m0 m1 s

solve :: [Int] -> (Int, Int, Int)
solve = (,,) <$> minimum <*> maximum <*> sum

