solve :: String -> [Int]
solve input = [minimum numList, maximum numList, sum numList]
	where
		numList = (map read) . words $ input

main = do
	n <- getLine
	input <- getLine
	putStrLn $ unwords . (map show) $ solve input 