minMaxSum :: [Integer] -> String
minMaxSum ns = unwords [show (minimum ns)
                       ,show (maximum ns)
                       ,show (sum     ns)]

main = do
  s' <- getContents
  let s = words ((lines s') !! 1)

  putStrLn $ minMaxSum $ map read s