n = gets.chomp.to_i
a = gets.chomp.split(" ").map{|x| x.to_i}
min = 1000000
max = −1000000
sum = 0
for i in 0..(n-1) do
  if a[i] < min
    min = a[i]
  end
  if max < a[i]
    max = a[i]
  end
  sum += a[i]
end
printf("%d %d %d\n",min, max, sum)
