import Control.Applicative

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