module Main where
 
import Control.Applicative
import Text.Printf
import Numeric
 
main :: IO ()
main = do
  { _ <- getLine
  ; xs <- getInts
  ; let mx = maximum xs
  ; let mn = minimum xs
  ; let sm = sum xs
  ; putInts [mn, mx, sm]
  }
  
--
  
getInts :: IO[Int]
getInts = map read . words <$> getLine
 
putInts :: [Int] -> IO()
putInts = putStrLn . unwords. map show
 
getDoubles :: IO[Double]
getDoubles = map read. words <$> getLine
 
putDoubles :: [Double] -> IO ()
putDoubles = putStrLn . unwords . map showDouble
 
showDouble :: Double -> String
showDouble x = showFFloat Nothing x ""
 
getStrings :: IO [String]
getStrings = words <$> getLine
 
readInt' :: String -> Int
readInt' = read

