'use strict';
process.stdin.on('data', function(chunk) {
    var inputs = chunk.toString().trim().split('\n');
	var params = inputs[1].split(' ').map(Number);
	var sum = params.reduce(function (a,b){
		return a+b;
	});
	var min	= params[0];
	var max	= params[0];
	for (var i = 0; i < params.length; i++) {
		min = Math.min(min,params[i]);
		max = Math.min(max,params[i]);
	}
   
    console.log(min,max,sum);
});
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
  data += chunk;
});