import java.util.*

fun main(args: Array<String>) {
	val sc = Scanner(System.`in`)
	val n = sc.nextLine().toLong()
	var a = arrayListOf<Long>()
	for (i in 1..n) {
		a.add(sc.nextLong())
	}
	println("${a.min()} ${a.max()} ${a.sum()}")
}
