import Control.Applicative

main :: IO ()
main = do
    _ <- getLine
    s <- map (read :: String -> Int) . words <$> getLine
    putStrLn $ (show $ minimum s) ++ " " ++ (show $ maximum s) ++ " " ++ (show $ sum s)
