import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val r = arrayListOf<Long>()
    (1..sc.nextInt()).forEach() {
        r.add(sc.nextInt().toLong())
    }
    println("${r.min()} ${r.max()} ${r.sum()}")
}

