function main(lines) {
    const input = lines.split('\n')
    const array = input[1].split(' ').map(function(val){return parseInt(val,10)})
    const min = array.reduce(function(a,b){return Math.min(a,b)})
    const max = array.reduce(function(a,b){return Math.max(a,b)})
    const sum = array.reduce(function(a,b){return a+b})

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