'use strict'

const main = arg => {
    const input = arg.trim().split("\n");
    var N = input[0];
    var nums = input[1].split(" ").slice(0, N).map(num => Number(num));
    var min = nums.sort((a, b) => a - b)[0];
    var max = nums.sort((a, b) => b - a)[0];
    var sum = nums.reduce((a, b) => a + b);

    console.log(`${min} ${max} ${sum}`);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
