function main(input){
    let lines = input.split("\n");
    let length = parseInt(lines[0]);
    let nums = lines[1].split(" ").map(x=>parseInt(x));

    console.log(Math.min(...nums)+" "+Math.max(...nums)+" "+nums.reduce((sum,x)=>sum+=x));

    
}


main(require("fs").readFileSync("/dev/stdin","utf-8"));
