n = gets.to_i
a = gets.split.map(&:to_i)
min = 10000000
max = -10000000
sum = 0
n.times do|i|
  x = a[i]
  if x < min
    min = x
  end
  if x > max
    max = x
  end
sum += x
end
printf("%d %d %d\n", min, max, sum)

