module Main where

import Data.Functor
import Data.Maybe

main :: IO ()
main =  do
 { [n] <- getInts
 ; ns  <- getInts
 ; putStrLn $ unwords $ map show $ [minimum ns, maximum ns, sum ns]
 }

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