process.stdin.resume();
process.stdin.setEncoding('utf8');
// Here your code !
var input_text="";
process.stdin.on("data",function(chunk){
   input_text+=chunk.toString();
});
process.stdin.on("end",function(){   
   var line = input_text.trim().split("\n");
   var num = line[1].split(" ").map(function(e){return e*1});
   var min = Math.min.apply(null,num);
   var max = Math.max.apply(null,num);
   var sum = num.reduce(function(a,b){return a+b});
   
   console.log(min.toString()+" "+max.toString()+" "+sum.toString());    
});