import Prelude hiding (min, max, sum)

import Data.Functor ((<$>))

min (x:xs) = go x xs
  where
  go x [] = x
  go x (y:ys) = if x < y then go x ys else go y ys

max (x:xs) = go x xs
  where
  go x [] = x
  go x (y:ys) = if x > y then go x ys else go y ys

sum = foldr (\x a -> x + a) 0

main = do
  _ <- getLine
  xs <- map read . words <$> getLine
  putStrLn $ unwords $ map show [min xs, max xs, sum xs]

