import scala.io.StdIn.readLine

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