object Main extends App {
	override def main(args: Array[String]) = {
		val sc = new java.util.Scanner(System.in)
		
		val n : Int = sc.nextInt
		
		var min : Int = 1000000
		var max : Int = -1000000 
		var sum : Int = 0
		for(_ <- 1 to n){
			val x:Int = sc.nextInt
			min = Math.min(x,min)
			max = Math.max(x,max)
			sum = x + sum
		}
		println(f"$min%d $max%d $sum%d")
	}
}