import java.util.Scanner

fun main(args :Array<String>){
    val cin = Scanner(System.`in`)
    val data = mutableListOf<Long>()
    var n :Int = cin.nextInt()
    
    while(n > 0){
	data.add(cin.nextLong())
	n--
    }

    data.sort()
    println("${data.min()} ${data.max()} ${data.sum()}")
}


