#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  long long sum = 0;
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
    sum += a[i];
  }
  int q;
  vector<int> b(q), c(q);
  cin >> q;
  for (int i = 0; i < (int)(q); i++) {
    cin >> b[i] >> c[i];
    b[i]--;
  }
  for (int i = 0; i < (int)(q); i++) {
    sum -= a[b[i]];
    sum += c[b[i]];
    cout << sum << endl;
  }
}
