main = do
    _ <- getLine
    line <- getLine
    let array = map read $ words line
    let a = minimum array
    let b = maximum array
    let c = sum array
    putStrLn $ (show a) ++ " " ++ (show b) ++ " " ++ (show c)
