n = gets.to_i
num = gets.split.map(&:to_i)

min, max, sum = num[0], num[0], 0

for i in 0..(n-1)
    if min > num[i]
        min = num[i]
    end
    if max < num[i]
        max = num[i]
    end
    sum += num[i]
end

puts "#{min} #{max} #{sum}"