import Data.Functor ((<$>))

main :: IO ()
main = do
  n <- read <$> getLine
  as <- map (read :: String -> Int) . take n . words <$> getLine
  putStrLn $ unwords $ fmap show <$> [minimum, maximum, sum] <*> pure as

