import scala.io.StdIn.readLine

object Main {
  def main(args:Array[String]):Unit = {
    val N:Int = readLine().toInt
    val data = readLine().split(" ").map(_.toInt)
    println("%d %d %d".format(data.min, data.max, data.sum))
  }
}