import scala.io.StdIn

object Main {
  def main(args:Array[String]){
    val n=StdIn.readLine
    val list=StdIn.readLine.split(" ").map(_.toInt).toList
    println(s"${list.min} ${list.max} ${list.sum}")
  }
}