function myout(text){console.log(text);}//standard output
function Main(input) {
	//input = parseInt(input);
	//input = input.trim().split(" ");
	input = input.trim().split("\n");
	//input = input.trim().split(" ").map((a)=>Number(a));
	//input = input.trim().split("\n").map((a)=>Number(a));
  var N = parseInt(input[0]);
  var time = 0;
  var times = input[1].split(" ").map((a)=>Number(a));
  for(var i = 0; i < times.length; i++){
    time += times[i];
  }
  
  var M = parseInt(input[2]);
  var output = [];
  for(var i = 3; i < M + 3; i++){
    var tmp = input[i].split(" ").map((a)=>Number(a));
    output.push(time - (times[tmp[0] - 1] - tmp[1]));
  }
  myout(output.join("\n"));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
