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

main :: IO ()
main = do
    _    <- getLine
    line <- getLine
    let
        nums = parseInts line
        minN = minimum nums
        maxN = maximum nums
        sumN = sum nums
    putStrLn . unwords . map show $ [minN, maxN, sumN]