'use strict';
process.stdin.on('data', function(chunk) {
    var inputs = chunk.toString().trim().split('\n');
    var params = inputs[1].split(' ').map(Number);
    var min = Math.min.apply(null,params);
    var max = Math.max.apply(null,params);
    var sum = params.reduce(function(a,b) {
      return a + b;
    });

    console.log(min, max, sum);
});
process.stdin.resume();
process.stdin.setEncoding('utf8');