process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function (chunk) {
  
var Arr=input.split("\n");
var arr=(Arr[1]).split(" ").map(Number);
var min=arr.reduce(function(a,b){return Math.min(a,b);});
var max=arr.reduce(function(a,b){return Math.max(a,b);});
var sum=arr.reduce(function(a,b){return a+b;});

console.log(min+' '+max+' '+sun);
    
});