gets
arr = gets.split.map(&:to_i).to_a.inject{ |sum, n| sum + n }
MAX = -1000000
MIN = 1000000
min = arr.inject(MAX) do |cmin,	i|
  cmin < i ? cmin:i
end

max = arr.inject(MIN) do |cmax,	i|
  cmax > i ? cmax:i
end

puts "#{MIN} #{MAX} #{SUM}"