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

void main() {
	int[] xs;
	size_t[] ps;
	int n,m;
	readf("%d\n",&n);
	auto ts = readln.split.to!(int[]);
	scanf ("%d\n",&m);
	foreach (_;0..m) {
		size_t p;
		int x;
		readf("%d %d\n",&p,&x);
		ps ~= p - 1;
		xs ~= x;
	}
	auto sum = ts.sum;
	for(size_t i;i < m;++i)	{
		auto neg = ts[ps[i]] - xs[i];
		writeln(sum - neg);
	}
}
