import java.util.*

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

