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

typedef long long int ll;
ll n, T[sz], m, p, x;

int main()
{

    cin >> n;

    ll sum = 0;
    
    for(int i=1; i<=n; i++) cin >> T[i], sum += T[i];

    cin >> m;

    for(int i=1; i<=m; i++)
    {
        cin >> p >> x;

        ll res = sum;

        res -= T[p];

        res += x;

        cout << res << endl;
    }
    return 0;
}
