import Control.Applicative

main :: IO ()
main = do
  getLine
  xs <- fmap read . words <$> getLine :: IO [Int]
  putStr . show $ minimum xs
  putStr " "
  putStr . show $ maximum xs
  putStr " "
  putStrLn . show $ sum xs
  
