import scala.io.StdIn.readInt
import scala.io.StdIn.readLine

object Main extends App {
  val n = readInt
  val arr = readLine.split(" ").map(_.toInt)
  println(s"${arr.min} ${arr.max} ${arr.map(_.toLong).sum}")
}

