#include <bits/stdc++.h>
using namespace std;

int main()
{
	int N, M, sum = 0, P, X;
	cin >> N;
	vector<int> T(N);
	for (int i = 0; i < N; i++) {
		cin >> T[i];
		sum += T[i];
	}
	cin >> M;
	while (M--) {
		cin >> P >> X;
		cout << sum + X - T[P - 1] << endl;
	}
	return 0;
}
