var data = "";
var input = "";
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', function(chunk) {
  input += chunk;
});

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);

});