n = STDIN.gets
numbers = STDIN.gets
numbers = numbers.split(" ")
numbers = numbers.map(&:to_i)
suma = numbers.inject {|sum, n| sum + n }
max = numbers.max
min = numbers.min
print min.to_s + " " + max.to_s + " " + suma.to_s + "\n"