main = do
    n <- getLine
    xs <- getLine
    putStrLn $ calc $ map (read) $ words xs

calc :: [Int] -> String
calc xs =
    (show min) ++ " " ++ (show max) ++ " " ++ (show total)
    where
        min = minimum xs
        max = maximum xs
        total = sum xs

