import scala.io.StdIn.readLine

object Main {

  def main(args: Array[String]) = {
    readLine
    val l = readLine.split(" ").map(_.toInt)
    println(l.min+" "+l.max+" "+l.foldLeft(0.toLong)(_+_))
  }
}