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

max = num[0]
min = num[0]
sum = 0
num.each{|i|
  sum += i
  if max < i then
    max = i
  end
  if min > i then
    min = i
  end
}

printf "%d %d %d\n", min, max, sum;