#include <iostream>
using namespace std;
#define ll long long


int main() {
    int n, t[10000], m, p[10000], x[10000], sum = 0;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> t[i];
        sum += t[i];
    }
    cin >> m;
    for (int j = 0; j < m; ++j) {
        cin >> p[j] >> x[j];
        cout << sum - (t[p[j]-1] - x[j]) << endl;
    }
    return 0;
}
