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