#include<iostream>
#define ll long long
using namespace std;
int main(){
	ll a[151],n,b,c,m,sum=0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		sum+=a[i];
	}
	cin>>m;
	for(int i=1;i<=m;i++){
		cin>>b>>c;
		cout<<sum-a[b]+c<<endl;
	}
	return 0;
}