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

main :: IO ()
main = do
    _ <- getLine
    getLine >>= putStrLn . solve . map read . words