
object Main {
	def main(args: Array[String]): Unit = {
		val in = new java.util.Scanner(System.in)
		val n = in.nextInt()
		val buffer = scala.collection.mutable.ListBuffer[Int]()
		for(i <- 1 to n){  
		  val a = in.nextInt()
			buffer += a
		}
		val list = buffer.toList
		println(list.min+" " +list.max+" "+list.sum)   
	}

}