min=100;max=0;sum=0

n=gets.chomp.to_i
str=gets.chomp
num=Array.new
number=str.split
for i in 0..n-1 do
  num[i]=number[i].to_i
end

for i in 0..n-1 do
  if num[i]<min then
    min=num[i]
  end
  if num[i]>max then
    max=num[i]
  end
  sum+=num[i]
end

puts "#{min} #{max} #{sum}"