#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 1; i <= n; i++) cin >> arr[i];
  int t;
  cin >> t;
  while (t--) {
    int b, c, sum = 0;
    cin >> b >> c;
    for (int i = 1; i <= n; i++) {
      if (i == b) arr[i] = c;
      sum += arr[i];
    }
    cout << endl << sum << endl;
  }
  return 0;
}
