main = do
  n    <- getLine
  line <- getLine
  let 
    ls   = map read $ words line :: [Int]
    minv = foldr min 10000 ls
    maxv = foldr max 0 ls
    sumv = sum ls
    in
      putStrLn $ (show minv) ++ " " ++ (show maxv) ++ " " ++ (show sumv)

