import Control.Applicative
import Text.Printf

main :: IO ()
main = do
  n <- read <$> getLine :: IO Int
  xs <- (map read . words) <$> getLine
  putStrLn $ solve xs

solve :: [Int] -> String
solve xs = show (minimum xs) ++ " " ++ show (maximum xs) ++ " " ++ show (sum xs)