'use strict';
var data = '';
process.stdin.on('end', function() {
    var inputs = data.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.max(max,params[i]);
    }
 
    console.log(min, max, sum);
 
});
 
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
  data += chunk;
});