class MinMaxSum {
  def inputScanner: List[Int] = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    List.fill(n)(sc.nextInt)
  }
  def check(list: List[Int] ): Unit = {
   val ma = list.max
   val mi = list.min
   val sum:Long = list.sum
    println(s"$mi $ma $sum")
  }
}
object Main {

  def main(args: Array[String]) {
    val c = new MinMaxSum
    c.check(c.inputScanner)
  }
}