object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val n = sc.nextInt
    def sub(a:Int,lim:Int,list: List[Int]):List[Int] = {
        if(a == lim) list
        else sub(a + 1 ,lim,list :+ sc.nextInt)
      }
    }

    val list = sub(0,n,Nil)
    println(s"${list.min} ${list.max} ${list.sum}")
  }
}