import           Control.Applicative
import           Text.Printf

main :: IO ()
main = do
    getLine
    xs <- fmap read . words <$> getLine :: IO [Int]
    printf "%d %d %d\n"
        (minimum xs)
        (maximum xs)
        (sum xs)

