module Main where

import Control.Applicative
import Text.Printf
import Numeric

main :: IO ()
main = do
  { _ <-getLine
  ; xs <- getInts
  ; let mx = maximum xs
  ; let mn = minimum xs
  ; let sm = sum xs
  ; putInts [mn , mx , sm ]
  }

  --

getInts :: IO [Int]
getInts = map read . words <$>getLine

putInts :: IO [Int]
putInts = putStrLn . unwords . map showDouble

getDoubles :: [Double] -> IO ()
getDoubles = map read . words <$> getLine

putDoubles :: [Double] -> IO ()
putDoubles = putStrLn . unwords . map showDouble

showDouble :: Double -> String
showDouble x = showFFloat Nothing x ""

