n=gets.chomp.to_i
answers = []

input_values = gets.chomp.split.map(&:to_i)
# i = 0
# (n-1).times do
#   (n-1).times do |i|
#     if input_values[i] > input_values[i+1]
#       tmp = input_values[i+1]
#       input_values[i+1] = input_values[i]
#       input_values[i] = tmp
#     end
#   end
# end
#
# min = input_values[0]
# max = input_values[-1]
# sum = 0
# i = 0
# n.times do
#   sum += input_values[i]
#   i += 1
# end
# answers.push(min, max, sum)
# puts answers.join(' ')

def search_min(array, length)
  min = array[0]
  for i in 1..(length-1)
    if min > array[i]
      min = array[i]
    end
  end
  return min
end

def search_max(array, length)
  max = array[0]
  for i in 1..(length-1)
    if max < array[i]
      max = array[i]
    end
  end
  return max
end

def calc_sum(array, length)
  sum = 0
  for i in 0..(length-1)
    sum += array[i]
  end
  return sum
end

answers.push(search_min(input_values, n), search_max(input_values, n), calc_sum(input_values, n))
puts answers.join(' ')