n = gets.to_i

x1 = gets()
x2 = x1.split()
i = 1
min = x2[0].to_i
max = x2[0].to_i
sum = 0
while i <= n-1
 if min >= x2[i].to_i
  min = x2[i].to_i
 end
 i += 1
end

h = 1
while h <= n-1
 if max <= x2[h].to_i
  max = x2[h].to_i
 end
 h += 1
end

j = 0
while j <= n-1
 sum += x2[j].to_i
 j += 1
end
puts "#{min} #{max} #{sum}"
