n = gets.to_i
a = gets.split.map &:to_i

max = -1000000
min = 1000000
sum = 0
n.times do |i|
    if a[i] < min
        min = a[i]
    end
    if a[i] > max
        max = a[i]
    end
    sum += a[i]
end

puts [min,max,sum].join(" ")
