object Main{
  def main(args: Array[String]){
    val sc = new java.util.Scanner(System.in)
    val num = sc.nextInt
    var sum = 0
    var list = List[Int]()
    for(i <- 1 to num){
      val in = sc.nextInt
      list = in :: list
      sum = in + sum
    }

    println(list.min + " " + list.max + " " + sum)
  }
}