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

main :: IO ()
main = calcList  

calcList :: IO()
calcList = do 
  ns <- fmap(fmap (read :: String -> Int) . words) .lines <$> getContents 
  let list = tail $ foldl1 (++) ns
  let min = minimum list 
  let max= maximum list 
  let sum = foldl1 (+) list 
  printf "%d %d %d\n" min max sum
