n = gets.to_i
a = gets.split(" ")
for i in 0...n
    a[i] = a[i].to_i
end

min, max, sum = a[0], a[0], a[0]
for i in 1...n
    if (a[i] < min)
        min = a[i]
    end
    if (a[i] > max)
        max = a[i]
    end
    sum += a[i]
end
puts("#{min} #{max} #{sum}")

