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