
a = gets.to_i
b = gets.split().map(&:to_i)
min = 1000000
max = -1000000
sum = 0
for i in b do
  sum += i
  if i > max
    max = i
  end
  if min > i
    min = i
  end
end

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