def toi(a)
	b = []
	a.each do |n|
		b << n.to_i
	end
	b	
end
a = gets().to_i
b = toi(gets().split)
max = b[0]
min = b[0]
sum = b[0]

for n in 1 ... a
sum += b[n]
if max < b[n]
	max = b[n]
end
if min > b[n]
	min = b[n]
end
end

print("#{min} #{max} #{sum}\n")