function main(input){
	input = input.split("\n")
    var arr = input[2].split(" ").map(x=>parseInt(x))
  	//drink is 2d array containing (index+1, time)
	var drink = list(3,-1)
    let sum = 0
    for (let i = 0; i<arr.length; i++){
    	sum = sum + arr[i]
    }
  	for (let i = 0; i<drink.lenght;i++){
        d=drink[i]
    	console.log(sum-arr[d[0]-1]+d[1])
    }
}
var input = require("fs").readFileSync("/dev/stdin","utf8")
main(input)
  
