process.stdin.resume();
process.stdin.setEncoding('utf8');
// ???????????????????¨??????§
// Let's ?????£??¬????????????
process.stdin.on('data', function (chunk) {
 var lines = chunk.split('\n');
    var n = Number(lines[0]);
    var items = lines[1].split(' ').map(Number);
    var min = Infinity;
    var max = Infinity;
    var sum = 0;

for (var i = 0; i < items.length; i++) {
        var a = items[i];
        if (a < min) {
            min = a;
        }
        if (a > max) {
            max = a;
        }
        sum += a;
    }
    console.log('%d %d %d', min, max, sum)
});