import Text.Printf

solve4 as = printf "%d %d %d\n" mimm maxx summ
  where
    mimm = foldl1 min as
    maxx = foldl1 max as
    summ = foldl1 (+) as

main = do
  _ <- getLine
  as' <- getLine
  let as = map read. words $ as' :: [Int]
  solve4 as

