import std.stdio, std.string, std.range, std.algorithm, std.math, std.conv;

void main() {
  auto N = readln.chomp.to!int;
  auto T = readln.split.to!(int[]);
  auto M = readln.chomp.to!int;
  auto s = T.sum;
  foreach (i; 0..M) {
      auto inp = readln.split.to!(int[]);
      auto P = inp[0]-1, X = inp[1];
      writeln(s - T[P] + X);
  }
}
