import collection.JavaConversions._

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    
    val list = sc.drop(n).toList.map(_.toInt)
    
    println(s"${list.min} ${list.max} ${list.sum}")
  }
}
  