countNum = gets.to_i
aryNums = gets.split.map(&:to_i);

maxNum = aryNums[0];
minNum = aryNums[0];
sum = 0;

for num in 0..4 do

	if maxNum < aryNums[num] then
		
    	 maxNum = aryNums[num];
    	 
	end
    
    if minNum > aryNums[num] then
    	
        minNum = aryNums[num];
		
    end

    sum += aryNums[num];

end

puts minNum.to_s + " " + maxNum.to_s + " " + sum.to_s