import Text.Printf

parseInts :: String -> [Int]
parseInts = map (\x -> read x :: Int).words

main :: IO ()
main = do
    line <- getLine
    line <- getLine
    let
        nums = parseInts line
        minN = minimum nums
        maxN = maximum nums
        sumN = sum nums
    printf "%d %d %d\n" minN maxN sumN