#include<bits/stdc++.h>
using namespace std;
#define ll long long int
vector <pair<int,int>> l;
int main()
{
    ll a,b,c,g,h,i,sum=0;
    cin>>a;
    ll d[a];
    for(i=0;i<a;i++)
    {
        cin>>d[i];
        sum=sum+d[i];
    }
    cin>>b;
    ll e;
    for(i=0;i<b;i++)
    {
        cin>>c;
        cin>>e;
        l.push_back(make_pair(c,e));
    }
    for(i=0;i<b;i++)
    {
        e=l[i].first;
        c=sum-d[e-1]+l[i].second;
        cout<<c<<endl;
    }
    return 0;
}
