def array_integer(a)
	0.upto(a.count) {|x|
		a[x] = a[x].to_i
	}
	return a
end

n = STDIN.gets
n = n.to_i

nums = STDIN.gets.split(" ")
nums = array_integer(nums)

min = nums[0]
max = nums[0]
sum = 0

0.upto(n - 1) {|x|
	sum += nums[x]
	min = nums[x] if min > nums[x]
	max = nums[x] if max < nums[x]
}

print min, " ", max, " ", sum, "\n"

